From a07cba057fbdaf524b0a6ca0a19d70eef723ae35 Mon Sep 17 00:00:00 2001 From: ccoVeille <3875889+ccoVeille@users.noreply.github.com> Date: Mon, 27 May 2024 22:26:12 +0200 Subject: [PATCH 1/6] chore: fix typo in file name interacive => interactive --- cmd/{interacive.go => interactive.go} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename cmd/{interacive.go => interactive.go} (100%) diff --git a/cmd/interacive.go b/cmd/interactive.go similarity index 100% rename from cmd/interacive.go rename to cmd/interactive.go From 16f02d4fe490a3f2868d22d5560e84cb9a2f3d3d Mon Sep 17 00:00:00 2001 From: ccoVeille <3875889+ccoVeille@users.noreply.github.com> Date: Mon, 27 May 2024 22:53:50 +0200 Subject: [PATCH 2/6] chore: fix wrong comments and names also use the official names: - bcrypt - Base32 - Base64 - Base64 URL - SHA-1 - SHA-256 - SHA-512 - macOS - ... --- README.md | 34 ++++++++++++++++---------------- hugo/content/_index.md | 12 ++++++------ hugo/content/cli/sttr.md | 14 ++++++------- processors/ascii85.go | 4 ++-- processors/base32.go | 4 ++-- processors/base64.go | 6 +++--- processors/base64_test.go | 32 +++++++++++++++++++----------- processors/base64url.go | 6 +++--- processors/base64url_test.go | 32 +++++++++++++++++++----------- processors/crypto.go | 38 ++++++++++++++++++------------------ processors/crypto_test.go | 36 +++++++++++++++++----------------- processors/hex.go | 2 ++ processors/html.go | 2 ++ processors/ip.go | 2 +- processors/json.go | 18 ++++++++--------- processors/json_test.go | 22 ++++++++++----------- processors/lines.go | 10 +++++----- processors/markdown.go | 2 +- processors/morse.go | 3 ++- processors/rgb.go | 2 +- processors/rot.go | 2 +- processors/strings.go | 10 +++++----- 22 files changed, 158 insertions(+), 135 deletions(-) diff --git a/README.md b/README.md index 8aaac46..5eb0f48 100644 --- a/README.md +++ b/README.md @@ -46,7 +46,7 @@ curl -sfL https://raw.githubusercontent.com/abhimanyu003/sttr/main/install.sh | #### Webi -**MacOS / Linux** +**macOS / Linux** ``` curl -sS https://webi.sh/sttr | sh ``` @@ -155,16 +155,16 @@ echo "Hello World" | sttr base64-encode | sttr md5 #### Encode/Decode -- [x] **ascii85-encode** - Encode your text to ascii85 -- [x] **ascii85-decode** - Decode your ascii85 text -- [x] **base32-decode** - Decode your base32 text -- [x] **base32-encode** - Encode your text to base32 -- [x] **base64-decode** - Decode your base64 text -- [x] **base64-encode** - Encode your text to base64 -- [x] **base85-encode** - Encode your text to base85 -- [x] **base85-decode** - Decode your base85 text -- [x] **base64url-decode** - Decode your base64 url -- [x] **base64url-encode** - Encode your text to url +- [x] **ascii85-encode** - Encode your text to Ascii85 +- [x] **ascii85-decode** - Decode your Ascii85 text +- [x] **base32-decode** - Decode your Base32 text +- [x] **base32-encode** - Encode your text to Base32 +- [x] **base64-decode** - Decode your Base64 text +- [x] **base64-encode** - Encode your text to Base64 +- [x] **base85-encode** - Encode your text to Base85 +- [x] **base85-decode** - Decode your Base85 text +- [x] **base64url-decode** - Decode your Base64 URL +- [x] **base64url-encode** - Encode your text to URL - [x] **html-decode** - Unescape your HTML - [x] **html-encode** - Escape your HTML - [x] **rot13-encode** - Encode your text to ROT13 @@ -173,7 +173,7 @@ echo "Hello World" | sttr base64-encode | sttr md5 #### Hash -- [x] **bcrypt** - Get the Bcrypt hash of your text +- [x] **bcrypt** - Get the bcrypt hash of your text - [x] **md5** - Get the MD5 checksum of your text - [x] **sha1** - Get the SHA1 checksum of your text - [x] **sha256** - Get the SHA256 checksum of your text @@ -236,7 +236,7 @@ echo "Hello World" | sttr base64-encode | sttr md5 - [x] **extract-emails** - Extract emails from given text - [x] **extract-ip** - Extract IPv4 and IPv6 from your text -- [x] **extract-urls** - Extract URls your text ( we don't do ping check ) +- [x] **extract-urls** - Extract URLs your text ( we don't do ping check ) #### Other @@ -245,14 +245,14 @@ echo "Hello World" | sttr base64-encode | sttr md5 - [x] **interactive** - Use sttr in interactive mode - [x] **version** - Print the version of sttr - [x] **zeropad** - Pad a number with zeros -- [x] **and adding more....** +- [x] **and adding more...** # Featured On -These are the few locations where `sttr` was highlighted, many thanks to all of you. -Please feel free to add any blogs/videos you may have made that discuss `sttr` to the list. +These are the few places where `sttr` got featured, many thanks to everyone. +If you have talked about `sttr` in your blog/video feel to add that to the list. -* [Youtube: The Giants of Open Source - DevOps Paradox](https://youtu.be/4nFRKbY_HVE?t=2529?ref=abhimanyu003/sttr) +* [YouTube: The Giants of Open Source - DevOps Paradox](https://youtu.be/4nFRKbY_HVE?t=2529?ref=abhimanyu003/sttr) * [Terminal Trove - Tool of the Week](https://terminaltrove.com/sttr/?ref=abhimanyu003/sttr) * [nixCraft](https://www.cyberciti.biz/open-source/sttr-awesome-linux-unix-command-tool-for-transformation-string/?ref=abhimanyu003/sttr) diff --git a/hugo/content/_index.md b/hugo/content/_index.md index 90e96e1..5ecfacb 100644 --- a/hugo/content/_index.md +++ b/hugo/content/_index.md @@ -114,11 +114,11 @@ echo "Hello World" | sttr base64-encode | sttr md5 # ๐Ÿ’ฅ Supported Operations -* [sttr base32-decode]({{< relref "sttr_base32-decode.md" >}}) - Decode your base32 text +* [sttr base32-decode]({{< relref "sttr_base32-decode.md" >}}) - Decode your Base32 text * [sttr base32-encode]({{< relref "sttr_base32-encode.md" >}}) - Encode your text to Base32 -* [sttr base64-decode]({{< relref "sttr_base64-decode.md" >}}) - Decode your base64 text +* [sttr base64-decode]({{< relref "sttr_base64-decode.md" >}}) - Decode your Base64 text * [sttr base64-encode]({{< relref "sttr_base64-encode.md" >}}) - Encode your text to Base64 -* [sttr bcrypt]({{< relref "sttr_bcrypt.md" >}}) - Get the Bcrypt hash of your text +* [sttr bcrypt]({{< relref "sttr_bcrypt.md" >}}) - Get the bcrypt hash of your text * [sttr camel]({{< relref "sttr_camel.md" >}}) - Transform your text to CamelCase * [sttr completion]({{< relref "sttr_completion.md" >}}) - generate the autocompletion script for the specified shell * [sttr count-chars]({{< relref "sttr_count-chars.md" >}}) - Find the length of your text (including spaces) @@ -138,9 +138,9 @@ echo "Hello World" | sttr base64-encode | sttr md5 * [sttr md5]({{< relref "sttr_md5.md" >}}) - Get the MD5 checksum of your text * [sttr reverse]({{< relref "sttr_reverse.md" >}}) - Reverse Text ( txeT esreveR ) * [sttr rot13-encode]({{< relref "sttr_rot13-encode.md" >}}) - Encode your text to ROT13 -* [sttr sha1]({{< relref "sttr_sha1.md" >}}) - Get the SHA1 checksum of your text -* [sttr sha256]({{< relref "sttr_sha256.md" >}}) - Get the SHA256 checksum of your text -* [sttr sha512]({{< relref "sttr_sha512.md" >}}) - Get the SHA512 checksum of your text +* [sttr sha1]({{< relref "sttr_sha1.md" >}}) - Get the SHA-1 checksum of your text +* [sttr sha256]({{< relref "sttr_sha256.md" >}}) - Get the SHA-256 checksum of your text +* [sttr sha512]({{< relref "sttr_sha512.md" >}}) - Get the SHA-512 checksum of your text * [sttr slug]({{< relref "sttr_slug.md" >}}) - Transform your text to slug-case * [sttr snake]({{< relref "sttr_snake.md" >}}) - Transform your text to snake_case * [sttr sort-lines]({{< relref "sttr_sort-lines.md" >}}) - Sort lines alphabetically diff --git a/hugo/content/cli/sttr.md b/hugo/content/cli/sttr.md index d4fe411..539cc85 100644 --- a/hugo/content/cli/sttr.md +++ b/hugo/content/cli/sttr.md @@ -7,7 +7,7 @@ sttr is a fast and flexible string/text converter ### Synopsis -sttr is a command line tool that allows you to quickly apply various +sttr is a command line tool that allows you to quickly apply various transformation operations on the input text. Complete documentation is available at https://github.com/abhimanyu003/sttr @@ -24,11 +24,11 @@ sttr [flags] ### SEE ALSO -* [sttr base32-decode]({{< relref "sttr_base32-decode.md" >}}) - Decode your base32 text +* [sttr base32-decode]({{< relref "sttr_base32-decode.md" >}}) - Decode your Base32 text * [sttr base32-encode]({{< relref "sttr_base32-encode.md" >}}) - Encode your text to Base32 -* [sttr base64-decode]({{< relref "sttr_base64-decode.md" >}}) - Decode your base64 text +* [sttr base64-decode]({{< relref "sttr_base64-decode.md" >}}) - Decode your Base64 text * [sttr base64-encode]({{< relref "sttr_base64-encode.md" >}}) - Encode your text to Base64 -* [sttr bcrypt]({{< relref "sttr_bcrypt.md" >}}) - Get the Bcrypt hash of your text +* [sttr bcrypt]({{< relref "sttr_bcrypt.md" >}}) - Get the bcrypt hash of your text * [sttr camel]({{< relref "sttr_camel.md" >}}) - Transform your text to CamelCase * [sttr completion]({{< relref "sttr_completion.md" >}}) - generate the autocompletion script for the specified shell * [sttr count-chars]({{< relref "sttr_count-chars.md" >}}) - Find the length of your text (including spaces) @@ -48,9 +48,9 @@ sttr [flags] * [sttr md5]({{< relref "sttr_md5.md" >}}) - Get the MD5 checksum of your text * [sttr reverse]({{< relref "sttr_reverse.md" >}}) - Reverse Text ( txeT esreveR ) * [sttr rot13-encode]({{< relref "sttr_rot13-encode.md" >}}) - Encode your text to ROT13 -* [sttr sha1]({{< relref "sttr_sha1.md" >}}) - Get the SHA1 checksum of your text -* [sttr sha256]({{< relref "sttr_sha256.md" >}}) - Get the SHA256 checksum of your text -* [sttr sha512]({{< relref "sttr_sha512.md" >}}) - Get the SHA512 checksum of your text +* [sttr sha1]({{< relref "sttr_sha1.md" >}}) - Get the SHA-1 checksum of your text +* [sttr sha256]({{< relref "sttr_sha256.md" >}}) - Get the SHA-256 checksum of your text +* [sttr sha512]({{< relref "sttr_sha512.md" >}}) - Get the SHA-512 checksum of your text * [sttr slug]({{< relref "sttr_slug.md" >}}) - Transform your text to slug-case * [sttr snake]({{< relref "sttr_snake.md" >}}) - Transform your text to snake_case * [sttr sort-lines]({{< relref "sttr_sort-lines.md" >}}) - Sort lines alphabetically diff --git a/processors/ascii85.go b/processors/ascii85.go index 95ec0c3..d298f7f 100644 --- a/processors/ascii85.go +++ b/processors/ascii85.go @@ -7,7 +7,7 @@ import ( "io" ) -// ASCII85Encoding encode string to base64. +// ASCII85Encoding encodes plain text to Ascii85 (aka Base85) type ASCII85Encoding struct{} func (p ASCII85Encoding) Name() string { @@ -49,7 +49,7 @@ func (p ASCII85Encoding) FilterValue() string { return p.Title() } -// ASCII85Decoding encode string to Ascii aka base85. +// ASCII85Decoding decodes Ascii85 (aka Base85) to plain text. type ASCII85Decoding struct{} func (p ASCII85Decoding) Name() string { diff --git a/processors/base32.go b/processors/base32.go index 60df087..c410cf6 100644 --- a/processors/base32.go +++ b/processors/base32.go @@ -5,7 +5,7 @@ import ( "fmt" ) -// Base32Encoding encode string to base64. +// Base32Encoding encodes plain text to Base32 string. type Base32Encoding struct{} func (p Base32Encoding) Name() string { @@ -37,7 +37,7 @@ func (p Base32Encoding) FilterValue() string { return p.Title() } -// Base32Decode decode string from base64 to plain text. +// Base32Decode decodes string from Base32 string to plain text. type Base32Decode struct{} func (p Base32Decode) Name() string { diff --git a/processors/base64.go b/processors/base64.go index 27524d2..7ec9c95 100644 --- a/processors/base64.go +++ b/processors/base64.go @@ -26,7 +26,7 @@ func checkBase64RawFlag(f []Flag) bool { return raw } -// Base64Encode encode string to base64. +// Base64Encode encodes plain text to Base64 string. type Base64Encode struct{} func (p Base64Encode) Name() string { @@ -61,7 +61,7 @@ func (p Base64Encode) FilterValue() string { return p.Title() } -// Base64Decode decode string from base64 to plain text. +// Base64Decode decodes string from Base64 string to plain text. type Base64Decode struct{} func (p Base64Decode) Name() string { @@ -93,7 +93,7 @@ func (p Base64Decode) Title() string { } func (p Base64Decode) Description() string { - return "Decode your base64 text" + return "Decode your Base64 text" } func (p Base64Decode) FilterValue() string { diff --git a/processors/base64_test.go b/processors/base64_test.go index 3f7d143..c148414 100644 --- a/processors/base64_test.go +++ b/processors/base64_test.go @@ -57,15 +57,18 @@ func TestBase64Encode_Transform(t *testing.T) { name: "String", args: args{data: []byte("the quick brown fox jumps over a lazy dog")}, want: "dGhlIHF1aWNrIGJyb3duIGZveCBqdW1wcyBvdmVyIGEgbGF6eSBkb2c=", - }, { + }, + { name: "Emoji", args: args{data: []byte("๐Ÿ˜ƒ๐Ÿ˜‡๐Ÿ™ƒ๐Ÿ™‚๐Ÿ˜‰๐Ÿ˜Œ๐Ÿ˜™๐Ÿ˜—๐Ÿ‡ฎ๐Ÿ‡ณ")}, want: "8J+Yg/CfmIfwn5mD8J+ZgvCfmInwn5iM8J+YmfCfmJfwn4eu8J+Hsw==", - }, { + }, + { name: "Multi line string", args: args{data: []byte("123345\nabcd\n456\n123\nabc\n567\n7890")}, want: "MTIzMzQ1CmFiY2QKNDU2CjEyMwphYmMKNTY3Cjc4OTA=", - }, { + }, + { name: "Test For baser64 standard Encoding", args: args{data: []byte("๏ฟฝ")}, want: "77+9", @@ -74,15 +77,18 @@ func TestBase64Encode_Transform(t *testing.T) { name: "String", args: args{data: []byte("the quick brown fox jumps over a lazy dog"), in1: []Flag{{Short: "r", Value: true}}}, want: "dGhlIHF1aWNrIGJyb3duIGZveCBqdW1wcyBvdmVyIGEgbGF6eSBkb2c", - }, { + }, + { name: "Emoji", args: args{data: []byte("๐Ÿ˜ƒ๐Ÿ˜‡๐Ÿ™ƒ๐Ÿ™‚๐Ÿ˜‰๐Ÿ˜Œ๐Ÿ˜™๐Ÿ˜—๐Ÿ‡ฎ๐Ÿ‡ณ"), in1: []Flag{{Short: "r", Value: true}}}, want: "8J+Yg/CfmIfwn5mD8J+ZgvCfmInwn5iM8J+YmfCfmJfwn4eu8J+Hsw", - }, { + }, + { name: "Multi line string", args: args{data: []byte("123345\nabcd\n456\n123\nabc\n567\n7890"), in1: []Flag{{Short: "r", Value: true}}}, want: "MTIzMzQ1CmFiY2QKNDU2CjEyMwphYmMKNTY3Cjc4OTA", - }, { + }, + { name: "Test For baser64 standard Encoding", args: args{data: []byte("๏ฟฝ"), in1: []Flag{{Short: "r", Value: true}}}, want: "77+9", @@ -113,7 +119,7 @@ func TestBase64Decode_Command(t *testing.T) { title string }{ alias: []string{"b64-dec", "b64-decode"}, - description: "Decode your base64 text", + description: "Decode your Base64 text", filterValue: "Base64 Decode (base64-decode)", flags: []Flag{base64RawFlag}, name: "base64-decode", @@ -155,11 +161,13 @@ func TestBase64Decode_Transform(t *testing.T) { name: "String", args: args{data: []byte("dGhlIHF1aWNrIGJyb3duIGZveCBqdW1wcyBvdmVyIGEgbGF6eSBkb2c=")}, want: "the quick brown fox jumps over a lazy dog", - }, { + }, + { name: "Emoji", args: args{data: []byte("8J+Yg/CfmIfwn5mD8J+ZgvCfmInwn5iM8J+YmfCfmJfwn4eu8J+Hsw==")}, want: "๐Ÿ˜ƒ๐Ÿ˜‡๐Ÿ™ƒ๐Ÿ™‚๐Ÿ˜‰๐Ÿ˜Œ๐Ÿ˜™๐Ÿ˜—๐Ÿ‡ฎ๐Ÿ‡ณ", - }, { + }, + { name: "Multi line string", args: args{data: []byte("MTIzMzQ1CmFiY2QKNDU2CjEyMwphYmMKNTY3Cjc4OTA=")}, want: "123345\nabcd\n456\n123\nabc\n567\n7890", @@ -173,11 +181,13 @@ func TestBase64Decode_Transform(t *testing.T) { name: "String", args: args{data: []byte("dGhlIHF1aWNrIGJyb3duIGZveCBqdW1wcyBvdmVyIGEgbGF6eSBkb2c"), in1: []Flag{{Short: "r", Value: true}}}, want: "the quick brown fox jumps over a lazy dog", - }, { + }, + { name: "Emoji", args: args{data: []byte("8J+Yg/CfmIfwn5mD8J+ZgvCfmInwn5iM8J+YmfCfmJfwn4eu8J+Hsw"), in1: []Flag{{Short: "r", Value: true}}}, want: "๐Ÿ˜ƒ๐Ÿ˜‡๐Ÿ™ƒ๐Ÿ™‚๐Ÿ˜‰๐Ÿ˜Œ๐Ÿ˜™๐Ÿ˜—๐Ÿ‡ฎ๐Ÿ‡ณ", - }, { + }, + { name: "Multi line string", args: args{data: []byte("MTIzMzQ1CmFiY2QKNDU2CjEyMwphYmMKNTY3Cjc4OTA"), in1: []Flag{{Short: "r", Value: true}}}, want: "123345\nabcd\n456\n123\nabc\n567\n7890", diff --git a/processors/base64url.go b/processors/base64url.go index 7e58e35..5842d4a 100644 --- a/processors/base64url.go +++ b/processors/base64url.go @@ -5,7 +5,7 @@ import ( "fmt" ) -// Base64URLEncode encode string to base64. +// Base64URLEncode encodes plain text to Base64 URL string. type Base64URLEncode struct{} func (p Base64URLEncode) Name() string { @@ -40,7 +40,7 @@ func (p Base64URLEncode) FilterValue() string { return p.Title() } -// Base64URLDecode decode string from base64 to plain text. +// Base64URLDecode decodes Base64 URL string to plain text. type Base64URLDecode struct{} func (p Base64URLDecode) Name() string { @@ -72,7 +72,7 @@ func (p Base64URLDecode) Title() string { } func (p Base64URLDecode) Description() string { - return "Decode your base64 text with URL Safe" + return "Decode your Base64 text with URL Safe" } func (p Base64URLDecode) FilterValue() string { diff --git a/processors/base64url_test.go b/processors/base64url_test.go index ca1472c..4d6dc10 100644 --- a/processors/base64url_test.go +++ b/processors/base64url_test.go @@ -57,15 +57,18 @@ func TestBase64URLEncode_Transform(t *testing.T) { name: "String", args: args{data: []byte("the quick brown fox jumps over a lazy dog?")}, want: "dGhlIHF1aWNrIGJyb3duIGZveCBqdW1wcyBvdmVyIGEgbGF6eSBkb2c_", - }, { + }, + { name: "Emoji", args: args{data: []byte("๐Ÿ˜ƒ๐Ÿ˜‡๐Ÿ™ƒ๐Ÿ™‚๐Ÿ˜‰๐Ÿ˜Œ๐Ÿ˜™๐Ÿ˜—๐Ÿ‡ฎ๐Ÿ‡ณ")}, want: "8J-Yg_CfmIfwn5mD8J-ZgvCfmInwn5iM8J-YmfCfmJfwn4eu8J-Hsw==", - }, { + }, + { name: "Multi line string", args: args{data: []byte("123345\nabcd\n456\n123\nabc\n567\n7890?")}, want: "MTIzMzQ1CmFiY2QKNDU2CjEyMwphYmMKNTY3Cjc4OTA_", - }, { + }, + { name: "Test For base64url Encoding", args: args{data: []byte("๏ฟฝ")}, want: "77-9", @@ -74,15 +77,18 @@ func TestBase64URLEncode_Transform(t *testing.T) { name: "String", args: args{data: []byte("the quick brown fox jumps over a lazy dog?"), in1: []Flag{{Short: "r", Value: true}}}, want: "dGhlIHF1aWNrIGJyb3duIGZveCBqdW1wcyBvdmVyIGEgbGF6eSBkb2c_", - }, { + }, + { name: "Emoji", args: args{data: []byte("๐Ÿ˜ƒ๐Ÿ˜‡๐Ÿ™ƒ๐Ÿ™‚๐Ÿ˜‰๐Ÿ˜Œ๐Ÿ˜™๐Ÿ˜—๐Ÿ‡ฎ๐Ÿ‡ณ"), in1: []Flag{{Short: "r", Value: true}}}, want: "8J-Yg_CfmIfwn5mD8J-ZgvCfmInwn5iM8J-YmfCfmJfwn4eu8J-Hsw", - }, { + }, + { name: "Multi line string", args: args{data: []byte("123345\nabcd\n456\n123\nabc\n567\n7890?"), in1: []Flag{{Short: "r", Value: true}}}, want: "MTIzMzQ1CmFiY2QKNDU2CjEyMwphYmMKNTY3Cjc4OTA_", - }, { + }, + { name: "Test For base64url Encoding", args: args{data: []byte("๏ฟฝ")}, want: "77-9", @@ -113,7 +119,7 @@ func TestBase64URLDecode_Command(t *testing.T) { title string }{ alias: []string{"b64url-dec", "b64url-decode"}, - description: "Decode your base64 text with URL Safe", + description: "Decode your Base64 text with URL Safe", filterValue: "Base64URL Decode (base64url-decode)", flags: []Flag{base64RawFlag}, name: "base64url-decode", @@ -155,11 +161,13 @@ func TestBase64URLDecode_Transform(t *testing.T) { name: "String", args: args{data: []byte("dGhlIHF1aWNrIGJyb3duIGZveCBqdW1wcyBvdmVyIGEgbGF6eSBkb2c_")}, want: "the quick brown fox jumps over a lazy dog?", - }, { + }, + { name: "Emoji", args: args{data: []byte("8J-Yg_CfmIfwn5mD8J-ZgvCfmInwn5iM8J-YmfCfmJfwn4eu8J-Hsw==")}, want: "๐Ÿ˜ƒ๐Ÿ˜‡๐Ÿ™ƒ๐Ÿ™‚๐Ÿ˜‰๐Ÿ˜Œ๐Ÿ˜™๐Ÿ˜—๐Ÿ‡ฎ๐Ÿ‡ณ", - }, { + }, + { name: "Multi line string", args: args{data: []byte("MTIzMzQ1CmFiY2QKNDU2CjEyMwphYmMKNTY3Cjc4OTA_")}, want: "123345\nabcd\n456\n123\nabc\n567\n7890?", @@ -173,11 +181,13 @@ func TestBase64URLDecode_Transform(t *testing.T) { name: "String", args: args{data: []byte("dGhlIHF1aWNrIGJyb3duIGZveCBqdW1wcyBvdmVyIGEgbGF6eSBkb2c_"), in1: []Flag{{Short: "r", Value: true}}}, want: "the quick brown fox jumps over a lazy dog?", - }, { + }, + { name: "Emoji", args: args{data: []byte("8J-Yg_CfmIfwn5mD8J-ZgvCfmInwn5iM8J-YmfCfmJfwn4eu8J-Hsw"), in1: []Flag{{Short: "r", Value: true}}}, want: "๐Ÿ˜ƒ๐Ÿ˜‡๐Ÿ™ƒ๐Ÿ™‚๐Ÿ˜‰๐Ÿ˜Œ๐Ÿ˜™๐Ÿ˜—๐Ÿ‡ฎ๐Ÿ‡ณ", - }, { + }, + { name: "Multi line string", args: args{data: []byte("MTIzMzQ1CmFiY2QKNDU2CjEyMwphYmMKNTY3Cjc4OTA_"), in1: []Flag{{Short: "r", Value: true}}}, want: "123345\nabcd\n456\n123\nabc\n567\n7890?", diff --git a/processors/crypto.go b/processors/crypto.go index d9aa8a4..94f89ac 100644 --- a/processors/crypto.go +++ b/processors/crypto.go @@ -11,7 +11,7 @@ import ( "golang.org/x/crypto/bcrypt" ) -// MD5 encode string to md5. +// MD5 encodes string to MD5. type MD5 struct{} func (p MD5) Name() string { @@ -46,7 +46,7 @@ func (p MD5) FilterValue() string { return p.Title() } -// SHA1 encode string to sha1. +// SHA1 encodes string to SHA-1. type SHA1 struct{} func (p SHA1) Name() string { @@ -70,19 +70,19 @@ func (p SHA1) Flags() []Flag { } func (p SHA1) Title() string { - title := "SHA1 Sum" + title := "SHA-1 Sum" return fmt.Sprintf("%s (%s)", title, p.Name()) } func (p SHA1) Description() string { - return "Get the SHA1 checksum of your text" + return "Get the SHA-1 checksum of your text" } func (p SHA1) FilterValue() string { return p.Title() } -// SHA256 encode string to sha256. +// SHA256 encodes string to SHA-256. type SHA256 struct{} func (p SHA256) Name() string { @@ -106,19 +106,19 @@ func (p SHA256) Flags() []Flag { } func (p SHA256) Title() string { - title := "SHA256 Sum" + title := "SHA-256 Sum" return fmt.Sprintf("%s (%s)", title, p.Name()) } func (p SHA256) Description() string { - return "Get the SHA256 checksum of your text" + return "Get the SHA-256 checksum of your text" } func (p SHA256) FilterValue() string { return p.Title() } -// SHA512 encode string to sha256. +// SHA512 encodes string to SHA-512. type SHA512 struct{} func (p SHA512) Name() string { @@ -142,19 +142,19 @@ func (p SHA512) Flags() []Flag { } func (p SHA512) Title() string { - title := "SHA512 Sum" + title := "SHA-512 Sum" return fmt.Sprintf("%s (%s)", title, p.Name()) } func (p SHA512) Description() string { - return "Get the SHA512 checksum of your text" + return "Get the SHA-512 checksum of your text" } func (p SHA512) FilterValue() string { return p.Title() } -// SHA224 encode string to sha224. +// SHA224 encode string to SHA-224. type SHA224 struct{} func (p SHA224) Name() string { @@ -176,19 +176,19 @@ func (p SHA224) Flags() []Flag { } func (p SHA224) Title() string { - title := "sha224 Sum" + title := "SHA-224 Sum" return fmt.Sprintf("%s (%s)", title, p.Name()) } func (p SHA224) Description() string { - return "Get the SHA224 checksum of your text" + return "Get the SHA-224 checksum of your text" } func (p SHA224) FilterValue() string { return p.Title() } -// SHA224 encode string to sha224. +// SHA384 encodes string to SHA-384. type SHA384 struct{} func (p SHA384) Name() string { @@ -210,19 +210,19 @@ func (p SHA384) Flags() []Flag { } func (p SHA384) Title() string { - title := "sha384 Sum" + title := "SHA-384 Sum" return fmt.Sprintf("%s (%s)", title, p.Name()) } func (p SHA384) Description() string { - return "Get the SHA384 checksum of your text" + return "Get the SHA-384 checksum of your text" } func (p SHA384) FilterValue() string { return p.Title() } -// Bcrypt encode string to Bcrypt. +// Bcrypt encodes string to bcrypt. type Bcrypt struct{} func (p Bcrypt) Name() string { @@ -262,12 +262,12 @@ func (p Bcrypt) Flags() []Flag { } func (p Bcrypt) Title() string { - title := "Bcrypt Hash" + title := "bcrypt Hash" return fmt.Sprintf("%s (%s)", title, p.Name()) } func (p Bcrypt) Description() string { - return "Get the Bcrypt hash of your text" + return "Get the bcrypt hash of your text" } func (p Bcrypt) FilterValue() string { diff --git a/processors/crypto_test.go b/processors/crypto_test.go index 79a15e6..ba37626 100644 --- a/processors/crypto_test.go +++ b/processors/crypto_test.go @@ -122,11 +122,11 @@ func TestSHA1Encode_Command(t *testing.T) { title string }{ alias: []string{"sha1-sum"}, - description: "Get the SHA1 checksum of your text", - filterValue: "SHA1 Sum (sha1)", + description: "Get the SHA-1 checksum of your text", + filterValue: "SHA-1 Sum (sha1)", flags: nil, name: "sha1", - title: "SHA1 Sum (sha1)", + title: "SHA-1 Sum (sha1)", } p := SHA1{} if got := p.Alias(); !reflect.DeepEqual(got, test.alias) { @@ -203,11 +203,11 @@ func TestSHA256Encode_Command(t *testing.T) { title string }{ alias: []string{"sha256-sum"}, - description: "Get the SHA256 checksum of your text", - filterValue: "SHA256 Sum (sha256)", + description: "Get the SHA-256 checksum of your text", + filterValue: "SHA-256 Sum (sha256)", flags: nil, name: "sha256", - title: "SHA256 Sum (sha256)", + title: "SHA-256 Sum (sha256)", } p := SHA256{} if got := p.Alias(); !reflect.DeepEqual(got, test.alias) { @@ -284,11 +284,11 @@ func TestSHA224Encode_Command(t *testing.T) { title string }{ alias: []string{"sha224-sum"}, - description: "Get the SHA224 checksum of your text", - filterValue: "sha224 Sum (sha224)", + description: "Get the SHA-224 checksum of your text", + filterValue: "SHA-224 Sum (sha224)", flags: nil, name: "sha224", - title: "sha224 Sum (sha224)", + title: "SHA-224 Sum (sha224)", } p := SHA224{} if got := p.Alias(); !reflect.DeepEqual(got, test.alias) { @@ -365,11 +365,11 @@ func TestSHA384Encode_Command(t *testing.T) { title string }{ alias: []string{"sha384-sum"}, - description: "Get the SHA384 checksum of your text", - filterValue: "sha384 Sum (sha384)", + description: "Get the SHA-384 checksum of your text", + filterValue: "SHA-384 Sum (sha384)", flags: nil, name: "sha384", - title: "sha384 Sum (sha384)", + title: "SHA-384 Sum (sha384)", } p := SHA384{} if got := p.Alias(); !reflect.DeepEqual(got, test.alias) { @@ -446,11 +446,11 @@ func TestSHA512Encode_Command(t *testing.T) { title string }{ alias: []string{"sha512-sum"}, - description: "Get the SHA512 checksum of your text", - filterValue: "SHA512 Sum (sha512)", + description: "Get the SHA-512 checksum of your text", + filterValue: "SHA-512 Sum (sha512)", flags: nil, name: "sha512", - title: "SHA512 Sum (sha512)", + title: "SHA-512 Sum (sha512)", } p := SHA512{} if got := p.Alias(); !reflect.DeepEqual(got, test.alias) { @@ -527,8 +527,8 @@ func TestBcrypt_Command(t *testing.T) { title string }{ alias: []string{"bcrypt-hash"}, - description: "Get the Bcrypt hash of your text", - filterValue: "Bcrypt Hash (bcrypt)", + description: "Get the bcrypt hash of your text", + filterValue: "bcrypt Hash (bcrypt)", flags: []Flag{ { Name: "number-of-rounds", @@ -539,7 +539,7 @@ func TestBcrypt_Command(t *testing.T) { }, }, name: "bcrypt", - title: "Bcrypt Hash (bcrypt)", + title: "bcrypt Hash (bcrypt)", } p := Bcrypt{} if got := p.Alias(); !reflect.DeepEqual(got, test.alias) { diff --git a/processors/hex.go b/processors/hex.go index eea71a3..ebf25eb 100644 --- a/processors/hex.go +++ b/processors/hex.go @@ -5,6 +5,7 @@ import ( "fmt" ) +// HexEncode encodes string to hexadecimal type HexEncode struct{} func (p HexEncode) Name() string { @@ -36,6 +37,7 @@ func (p HexEncode) FilterValue() string { return p.Title() } +// HexEncode decodes hexadecimal to string type HexDecode struct{} func (p HexDecode) Name() string { diff --git a/processors/html.go b/processors/html.go index f9512e5..9455bd5 100644 --- a/processors/html.go +++ b/processors/html.go @@ -5,6 +5,7 @@ import ( "html" ) +// HTMLEncode escapes string to HTML type HTMLEncode struct{} func (p HTMLEncode) Name() string { @@ -36,6 +37,7 @@ func (p HTMLEncode) FilterValue() string { return p.Title() } +// HTMLEncode unescapes HTML to string type HTMLDecode struct{} func (p HTMLDecode) Name() string { diff --git a/processors/ip.go b/processors/ip.go index 6bc0b07..f9870ac 100644 --- a/processors/ip.go +++ b/processors/ip.go @@ -7,7 +7,7 @@ import ( "strings" ) -// ExtractIPs encode string to base64. +// ExtractIPs extracts ipv4 and ipv6 from string. type ExtractIPs struct{} func (p ExtractIPs) FilterValue() string { diff --git a/processors/json.go b/processors/json.go index 8603d7f..c1465be 100644 --- a/processors/json.go +++ b/processors/json.go @@ -11,7 +11,7 @@ import ( "gitlab.com/abhimanyusharma003/go-ordered-json" ) -// FormatJSON format given string to a JSON with Indent. +// FormatJSON formats given string to a JSON with Indent. type FormatJSON struct{} func (p FormatJSON) Name() string { @@ -82,7 +82,7 @@ func (p FormatJSON) FilterValue() string { return p.Title() } -// JSONToYAML convert JSON to YAML string. +// JSONToYAML converts JSON to YAML string. type JSONToYAML struct{} func (p JSONToYAML) Name() string { @@ -106,7 +106,7 @@ func (p JSONToYAML) Flags() []Flag { } func (p JSONToYAML) Title() string { - title := "JSON To YAML" + title := "JSON to YAML" return fmt.Sprintf("%s (%s)", title, p.Name()) } @@ -118,7 +118,7 @@ func (p JSONToYAML) FilterValue() string { return p.Title() } -// JSONToMSGPACK convert JSON to MSGPACK string. +// JSONToMSGPACK converts JSON to MSGPACK string. type JSONToMSGPACK struct{} func (p JSONToMSGPACK) Name() string { @@ -162,7 +162,7 @@ func (p JSONToMSGPACK) FilterValue() string { return p.Title() } -// MSGPACKToJSON convert MSGPACK to JSON string. +// MSGPACKToJSON converts MSGPACK to JSON string. type MSGPACKToJSON struct{} func (p MSGPACKToJSON) Name() string { @@ -194,7 +194,7 @@ func (p MSGPACKToJSON) Flags() []Flag { } func (p MSGPACKToJSON) Title() string { - title := "MSGPACK To JSON" + title := "MSGPACK to JSON" return fmt.Sprintf("%s (%s)", title, p.Name()) } @@ -206,7 +206,7 @@ func (p MSGPACKToJSON) FilterValue() string { return p.Title() } -// YAMLToJSON convert YAML to JSON string with formatted output. +// YAMLToJSON converts YAML to JSON string with formatted output. type YAMLToJSON struct{} func (p YAMLToJSON) Name() string { @@ -245,7 +245,7 @@ func (p YAMLToJSON) FilterValue() string { return p.Title() } -// JSONUnescape unescape given string to a JSON with Indent. +// JSONUnescape unescapes given string to a JSON with Indent. type JSONUnescape struct{} func (p JSONUnescape) Name() string { @@ -303,7 +303,7 @@ func (p JSONUnescape) FilterValue() string { return p.Title() } -// JSONEscape unescape given string to a JSON with Indent. +// JSONEscape escape given string to a JSON with Indent. type JSONEscape struct{} func (p JSONEscape) Name() string { diff --git a/processors/json_test.go b/processors/json_test.go index fe42288..6d07549 100644 --- a/processors/json_test.go +++ b/processors/json_test.go @@ -195,8 +195,10 @@ func TestJSONToMSGPACK_Transform(t *testing.T) { { "List", "{\"data\":[\"1\", \"2\", \"3\"]}", - []byte{223, 0, 0, 0, 1, 164, 100, 97, 116, 97, 221, 0, 0, 0, 3, 161, 49, 161, 50, 161, - 51}, + []byte{ + 223, 0, 0, 0, 1, 164, 100, 97, 116, 97, 221, 0, 0, 0, 3, 161, 49, 161, 50, 161, + 51, + }, }, } @@ -222,7 +224,6 @@ func TestJSONToMSGPACK_Transform(t *testing.T) { t.Errorf("Transform() got = %v, want %v", resultInterface, wantInterface) } } - }) } } @@ -238,10 +239,10 @@ func TestMSGPACKToJSON_Command(t *testing.T) { }{ alias: []string{}, description: "Convert MSGPACK to JSON text", - filterValue: "MSGPACK To JSON (msgpack-json)", + filterValue: "MSGPACK to JSON (msgpack-json)", flags: nil, name: "msgpack-json", - title: "MSGPACK To JSON (msgpack-json)", + title: "MSGPACK to JSON (msgpack-json)", } p := MSGPACKToJSON{} if got := p.Alias(); !reflect.DeepEqual(got, test.alias) { @@ -283,8 +284,10 @@ func TestMSGPACKToJSON_Transform(t *testing.T) { { "List", "{\"data\":[\"1\", \"2\", \"3\"]}", - []byte{223, 0, 0, 0, 1, 164, 100, 97, 116, 97, 221, 0, 0, 0, 3, 161, 49, 161, 50, 161, - 51}, + []byte{ + 223, 0, 0, 0, 1, 164, 100, 97, 116, 97, 221, 0, 0, 0, 3, 161, 49, 161, 50, 161, + 51, + }, }, } for _, tt := range tests { @@ -310,7 +313,6 @@ func TestMSGPACKToJSON_Transform(t *testing.T) { t.Errorf("Transform() got = %v, want %v", resultInterface, wantInterface) } } - }) } } @@ -403,14 +405,12 @@ func TestJSONUnescape_Transform(t *testing.T) { wantErr: false, }, { - name: "Should return error on invalid input", args: args{data: []byte(`Invalid Input`)}, want: ``, wantErr: true, }, { - name: "Should return error on invalid JSON", args: args{data: []byte(`{\n \"name\: \"name is mising quote\"\n}`)}, want: ``, @@ -522,14 +522,12 @@ func TestJSONEscape_Transform(t *testing.T) { wantErr: false, }, { - name: "Should return error on invalid input", args: args{data: []byte(`Invalid Input`)}, want: ``, wantErr: true, }, { - name: "Should return error on invalid JSON", args: args{data: []byte(`{\n \"name\: \"name is mising quote\"\n}`)}, want: ``, diff --git a/processors/lines.go b/processors/lines.go index a262896..ec83751 100644 --- a/processors/lines.go +++ b/processors/lines.go @@ -10,7 +10,7 @@ import ( "time" ) -// CountLines count number of words in string. +// CountLines counts number of words in string. // Example: "line 1\n line 2" = 2. type CountLines struct{} @@ -47,7 +47,7 @@ func (p CountLines) FilterValue() string { return p.Title() } -// SortLines sort given lines, it's not a natural sort. +// SortLines sorts given lines, it's not a natural sort. // Example: 2\n 1\n -> 1\n 2\n. type SortLines struct{} @@ -82,7 +82,7 @@ func (p SortLines) FilterValue() string { return p.Title() } -// ShuffleLines sort given lines, in random order. +// ShuffleLines sorts given lines, in random order. type ShuffleLines struct{} func (p ShuffleLines) Name() string { @@ -124,7 +124,7 @@ func (p ShuffleLines) FilterValue() string { return p.Title() } -// UniqueLines sort given lines, in random order. +// UniqueLines sorts given lines, in random order. type UniqueLines struct{} func (p UniqueLines) Name() string { @@ -186,7 +186,7 @@ func (p UniqueLines) FilterValue() string { return p.Title() } -// ReverseLines sort given lines, in random order. +// ReverseLines sorts given lines, in random order. type ReverseLines struct{} func (p ReverseLines) Name() string { diff --git a/processors/markdown.go b/processors/markdown.go index 6387b04..6106329 100644 --- a/processors/markdown.go +++ b/processors/markdown.go @@ -7,7 +7,7 @@ import ( "github.com/yuin/goldmark" ) -// Markdown convert markdown to HTML. +// Markdown converts Markdown to HTML. type Markdown struct{} func (p Markdown) Name() string { diff --git a/processors/morse.go b/processors/morse.go index 0baa93a..1007506 100644 --- a/processors/morse.go +++ b/processors/morse.go @@ -95,7 +95,7 @@ var moreCodeMap = map[string]string{ "เน†": "10111", "เธฏ": "11010", } -// Base62Encoding encode string to base64. +// MorseCodeEncode encodes string to Morse Code. type MorseCodeEncode struct{} func (p MorseCodeEncode) Name() string { @@ -150,6 +150,7 @@ func (p MorseCodeEncode) FilterValue() string { return p.Title() } +// MorseCodeDecode decodes Morse Code to string type MorseCodeDecode struct{} func (p MorseCodeDecode) Name() string { diff --git a/processors/rgb.go b/processors/rgb.go index dc61c72..255b8c8 100644 --- a/processors/rgb.go +++ b/processors/rgb.go @@ -6,7 +6,7 @@ import ( "github.com/lucasb-eyer/go-colorful" ) -// HexToRGB convert hex color code to R, G, B codes +// HexToRGB converts hex color code to R, G, B codes // here we are using data library helper. type HexToRGB struct{} diff --git a/processors/rot.go b/processors/rot.go index da50a63..6287f26 100644 --- a/processors/rot.go +++ b/processors/rot.go @@ -5,7 +5,7 @@ import ( "strings" ) -// ROT13Encode convert string to ROT13 encoding. +// ROT13Encode converts string to ROT13 encoding. type ROT13Encode struct{} func (p ROT13Encode) Name() string { diff --git a/processors/strings.go b/processors/strings.go index cc0394b..ece05b2 100644 --- a/processors/strings.go +++ b/processors/strings.go @@ -244,7 +244,7 @@ func (p Slug) FilterValue() string { return p.Title() } -// CountCharacters count number of Characters including spaces. +// CountCharacters count number of characters including spaces. type CountCharacters struct{} func (p CountCharacters) Name() string { @@ -276,7 +276,7 @@ func (p CountCharacters) FilterValue() string { return p.Title() } -// CountWords count number of words in string. +// CountWords counts number of words in string. // Example: "hello world" = 2. type CountWords struct{} @@ -309,7 +309,7 @@ func (p CountWords) FilterValue() string { return p.Title() } -// Reverse reverse a given string +// Reverse reverses a given string // Example: "test" to "tset". type Reverse struct{} @@ -346,8 +346,8 @@ func (p Reverse) FilterValue() string { return p.Title() } -// EscapeQuotes escape quotes from a given string -// Example: "test" to \"tset\". +// EscapeQuotes escapes quotes from a given string +// Example: "test" to \"test\". type EscapeQuotes struct{} func (p EscapeQuotes) Name() string { From 231697ddecb0b40a786456810d3ec1c8b9cf33b6 Mon Sep 17 00:00:00 2001 From: ccoVeille <3875889+ccoVeille@users.noreply.github.com> Date: Mon, 27 May 2024 22:55:32 +0200 Subject: [PATCH 3/6] chore: fix Markdown fenced block identifiers --- README.md | 29 +++++++++++++++-------------- hugo/content/_index.md | 24 ++++++++++++------------ 2 files changed, 27 insertions(+), 26 deletions(-) diff --git a/README.md b/README.md index 5eb0f48..957072d 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ `sttr` is command line software that allows you to quickly run various transformation operations on the string. -```go +```shell // With input prompt sttr @@ -40,20 +40,21 @@ sttr yaml-json file.yaml > file-output.json You can run the below `curl` to install it somewhere in your PATH for easy use. Ideally it will be installed at `./bin` folder -```sh +```shell curl -sfL https://raw.githubusercontent.com/abhimanyu003/sttr/main/install.sh | sh ``` #### Webi **macOS / Linux** -``` + +```shell curl -sS https://webi.sh/sttr | sh ``` **Windows** -``` +```shell curl.exe https://webi.ms/sttr | powershell ``` @@ -63,20 +64,20 @@ See [here](https://webinstall.dev/sttr/) If you are on macOS and using Homebrew, you can install `sttr` with the following: -```go +```shell brew tap abhimanyu003/sttr brew install sttr ``` #### Snap -``` +```shell sudo snap install sttr ``` #### Arch Linux -``` +```shell yay -S sttr-bin ``` @@ -89,7 +90,7 @@ scoop install sttr #### Go -```go +```shell go install github.com/abhimanyu003/sttr@latest ``` @@ -102,7 +103,7 @@ to the desired location. * After installation simply run `sttr` command. -```go +```shell // For interactive menu sttr // Provide your input @@ -113,7 +114,7 @@ sttr * Working with help. -```go +```shell sttr -h // Example @@ -123,7 +124,7 @@ sttr md5 -h * Working with files input. -```go +```shell sttr {command-name} {filename} sttr base64-encode image.jpg @@ -133,19 +134,19 @@ sttr md-html Readme.md * Writing output to file. -```go +```shell sttr yaml-json file.yaml > file-output.json ``` * Taking input from other command. -```go +```shell curl https: //jsonplaceholder.typicode.com/users | sttr json-yaml ``` * Chaining the different processor. -```go +```shell sttr md5 hello | sttr base64-encode echo "Hello World" | sttr base64-encode | sttr md5 diff --git a/hugo/content/_index.md b/hugo/content/_index.md index 5ecfacb..2064a7e 100644 --- a/hugo/content/_index.md +++ b/hugo/content/_index.md @@ -4,7 +4,7 @@ `sttr` is command line software that allows you to quickly run various transformation operations on the string. -```go +```shell // With input prompt sttr @@ -35,7 +35,7 @@ sttr yaml-json file.yaml > file-output.json You can run the below `curl` to install it somewhere in your PATH for easy use. Ideally it will be installed at `./bin` folder -```go +```shell curl -sfL https://raw.githubusercontent.com/abhimanyu003/sttr/main/install.sh | sh ``` @@ -43,14 +43,14 @@ curl -sfL https://raw.githubusercontent.com/abhimanyu003/sttr/main/install.sh | If you are on macOS and using Homebrew, you can install `sttr` with the following: -```go +```shell brew tap abhimanyu003/sttr brew install sttr ``` -#### Go +#### Go -```go +```shell go install github.com/abhimanyu003/sttr@latest ``` @@ -62,9 +62,9 @@ Download the pre-compiled binaries from the [Release!](https://github.com/abhima * After installation simply run `sttr` command. -```go +```shell // For interactive menu -sttr +sttr // Provide your input // Press two enter to open operation menu // Press `/` to filter various operations. @@ -73,7 +73,7 @@ sttr * Working with help. -```go +```shell sttr -h // Example @@ -83,7 +83,7 @@ sttr md5 -h * Working with files input. -```go +```shell sttr {command-name} {filename} sttr base64-encode image.jpg @@ -93,19 +93,19 @@ sttr md-html Readme.md * Writing output to file. -```go +```shell sttr yaml-json file.yaml > file-output.json ``` * Taking input from other command. -```go +```shell curl https://jsonplaceholder.typicode.com/users | sttr json-yaml ``` * Chaining the different processor. -```go +```shell sttr md5 hello | sttr base64-encode echo "Hello World" | sttr base64-encode | sttr md5 From aa8768112fa6c628372872b45c72920173e0d415 Mon Sep 17 00:00:00 2001 From: ccoVeille <3875889+ccoVeille@users.noreply.github.com> Date: Mon, 27 May 2024 22:56:16 +0200 Subject: [PATCH 4/6] chore: fix typos --- processors/json_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/processors/json_test.go b/processors/json_test.go index 6d07549..36c45db 100644 --- a/processors/json_test.go +++ b/processors/json_test.go @@ -412,7 +412,7 @@ func TestJSONUnescape_Transform(t *testing.T) { }, { name: "Should return error on invalid JSON", - args: args{data: []byte(`{\n \"name\: \"name is mising quote\"\n}`)}, + args: args{data: []byte(`{\n \"name\: \"name is missing quote\"\n}`)}, want: ``, wantErr: true, }, @@ -529,7 +529,7 @@ func TestJSONEscape_Transform(t *testing.T) { }, { name: "Should return error on invalid JSON", - args: args{data: []byte(`{\n \"name\: \"name is mising quote\"\n}`)}, + args: args{data: []byte(`{\n \"name\: \"name is missing quote\"\n}`)}, want: ``, wantErr: true, }, From 3f0d119982d22afdcd9697f908668c5787003e94 Mon Sep 17 00:00:00 2001 From: ccoVeille <3875889+ccoVeille@users.noreply.github.com> Date: Mon, 27 May 2024 22:56:40 +0200 Subject: [PATCH 5/6] chore: fix invalid aliases for Morse decode --- processors/morse.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/processors/morse.go b/processors/morse.go index 1007506..072567b 100644 --- a/processors/morse.go +++ b/processors/morse.go @@ -158,7 +158,7 @@ func (p MorseCodeDecode) Name() string { } func (p MorseCodeDecode) Alias() []string { - return []string{"morse-enc", "morse-encode", "morse-code-encode", "morse-code-enc"} + return []string{"morse-dec", "morse-decode", "morse-code-decode", "morse-code-dec"} } func (p MorseCodeDecode) Transform(data []byte, _ ...Flag) (string, error) { From 01ae2bc280efc30ea66ea23af4d069079f818f02 Mon Sep 17 00:00:00 2001 From: ccoVeille <3875889+ccoVeille@users.noreply.github.com> Date: Mon, 27 May 2024 22:57:48 +0200 Subject: [PATCH 6/6] chore: fix acronyms case --- processors/processor.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/processors/processor.go b/processors/processor.go index f3b1900..61718d2 100644 --- a/processors/processor.go +++ b/processors/processor.go @@ -119,8 +119,8 @@ type Flag struct { // Zeropad is an Example processor to show how to add text processors, // it checks if the data is a number and pads it with zeros // Example implements 'Item' and 'DefaultItem' from package 'github.com/charmbracelet/bubbles/list' -// to work with the ui, and `Processor` from this package to do the text transformation and generation -// of the cli commands +// to work with the UI, and `Processor` from this package to do the text transformation and generation +// of the CLI commands // After implementing add the struct to List. type Zeropad struct{}