Skip to content

Add additional generic components and helpers#224

Merged
anujc25 merged 7 commits intomainfrom
add-plugin-helper
Feb 4, 2025
Merged

Add additional generic components and helpers#224
anujc25 merged 7 commits intomainfrom
add-plugin-helper

Conversation

@anujc25
Copy link
Copy Markdown
Contributor

@anujc25 anujc25 commented Jan 21, 2025

What this PR does / why we need it

Add additional generic components and helpers functions

  1. Adds Cobra command's Arg, Error and Extend helpers under command package
  2. Adds Emoji and special characters under component/icons package
  3. Adds string and color utils under component/stringutils package
  4. Adds TabWriter component under component/tabwriter package

Which issue(s) this PR fixes

Fixes #

Describe testing done for PR

Release note

Add Cobra command's `Arg`, `Error` and `Extend` helpers, Icons, Color printer and TabWriter component

Additional information

Special notes for your reviewer

@anujc25 anujc25 marked this pull request as ready for review January 23, 2025 17:55
@anujc25 anujc25 requested a review from a team as a code owner January 23, 2025 17:55
Comment on lines +13 to +20
var (
FaintColor = color.New(color.Faint)
InfoColor = color.New(color.FgCyan)
SuccessColor = color.New(color.FgGreen)
WarnColor = color.New(color.FgYellow)
ErrorColor = color.New(color.FgRed)
BoldColor = color.New(color.Bold)
)
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Noticed that we already have compnent/colorable-tty.go which holds similar color specific helpers. Check to see how we can combine both.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have deprecated some of the string helpers in colorable-tty.go and created a new package stringutils which includes all the string specific utils functions along with color specific helpers.

Copy link
Copy Markdown
Contributor

@marckhouzam marckhouzam left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice stuff.
Thanks for the effort!

@anujc25 anujc25 force-pushed the add-plugin-helper branch 2 times, most recently from 3fc5814 to 4fae43f Compare February 4, 2025 19:24
Copy link
Copy Markdown
Contributor

@marckhouzam marckhouzam left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM
Very nice.
If there are things to tweak when we start using this change in an existing plugin, we can fix in another PR.

@anujc25 anujc25 merged commit 4235cde into main Feb 4, 2025
@marckhouzam marckhouzam added this to the v1.5.0 milestone Feb 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants