Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(formatters): added pretty formatter for colored and wrapped cli output #1580

Merged
merged 3 commits into from
Apr 26, 2021

Conversation

amthorn
Copy link
Contributor

@amthorn amthorn commented Apr 18, 2021

Checklist

  • Tests added / updated
  • Docs added / updated

Does this PR introduce a breaking change?

  • Yes
  • No

Screenshots

Complex Wrapping:
Screen Shot 2021-04-17 at 4 44 19 AM

With Stylish:
Screen Shot 2021-04-17 at 9 24 08 PM

With Pretty:
Screen Shot 2021-04-17 at 9 24 51 PM

Additional context

I've added this due to the stylish formatter being somewhat rough on certain terminals based on their terminal width and based on the spec file. For some very long spec files, the paths and line numbers are longer than the expected terminal width. Additionally, the colors are very subtle and easy to miss. It's often difficult to read and doesn't wrap appropriately (See screenshot above of the comparison of stylish to pretty)

roubles
roubles previously approved these changes Apr 19, 2021
P0lip
P0lip previously approved these changes Apr 22, 2021
Copy link
Contributor

@P0lip P0lip left a comment

Choose a reason for hiding this comment

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

Looks cool. I like it. Thanks a lot!
Left a few minor suggestions.

src/cli/formatters/pretty.ts Outdated Show resolved Hide resolved
src/cli/formatters/__tests__/pretty.test.ts Outdated Show resolved Hide resolved
src/cli/formatters/pretty.ts Outdated Show resolved Hide resolved
src/cli/formatters/pretty.ts Outdated Show resolved Hide resolved
Committing PR review suggestions:)

Co-authored-by: Jakub Rożek <[email protected]>
@amthorn amthorn dismissed stale reviews from P0lip and roubles via ec07677 April 24, 2021 05:57
@amthorn
Copy link
Contributor Author

amthorn commented Apr 24, 2021

@P0lip commited your requested changes:) thanks! ran yarn lint + yarn test again. All looks good. Thanks for letting me contribute:)

Copy link
Contributor

@P0lip P0lip left a comment

Choose a reason for hiding this comment

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

Thanks again! Really appreciate it.

@P0lip P0lip merged commit 2e5d48e into stoplightio:develop Apr 26, 2021
@amthorn amthorn deleted the pretty_formatter branch April 26, 2021 19:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants