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

Add unix formatter #3524

Merged
merged 3 commits into from Aug 14, 2018
Merged

Add unix formatter #3524

merged 3 commits into from Aug 14, 2018

Conversation

ybiquitous
Copy link
Member

Which issue, if any, is this issue related to?

Fixes #3522

Is there anything in the PR that needs further explanation?

No, it's self explanatory.

lib/cli.js Outdated
@@ -234,7 +243,7 @@ const meowOptions /*: meowOptionsType*/ = {

--formatter, -f [default: "string"]

The output formatter: "compact", "json", "string" or "verbose".
The output formatter: ${formatterOptions}.
Copy link
Member Author

Choose a reason for hiding this comment

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

To avoid a bug such as #3521, I change to generate a formatter options text from formatters object.
But there are no tests for help text, so I don't add test cases for this change.

Here is a partial help text related to this change, which is output in my CLI termial:

$ ./bin/stylelint.js -h | grep -C3 '\-\-formatter' 
      If the directory for the cache does not exist, make sure you add a trailing "/"
      on *nix systems or "\" on Windows. Otherwise the path will be assumed to be a file.

    --formatter, -f               [default: "string"]

      The output formatter: "compact", "json", "string", "unix" or "verbose".

This change may be over-engineering, so I want to hear opinions of reviewes about this change.
(I will go back to hard-coded text, if there are more oppositions)

Copy link
Member

@ntwb ntwb left a comment

Choose a reason for hiding this comment

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

@ybiquitous
Copy link
Member Author

Thanks for a feedback! I will change also docs/user-guide/node-api.md

https://github.com/stylelint/stylelint/blob/700b7fb7419678e0c903172e67054405c1a79ccf/docs/user-guide/node-api.md

lib/cli.js Outdated
.join(", ")
.value()
.replace(/, ([a-z"]+)$/u, " or $1");

Copy link
Member

Choose a reason for hiding this comment

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

Rather than defining formatterOptions multiple times (above and in lib/standalone.js), perhaps making this a util in lib/utils with some tests.

The above is not a blocker, but would be nice to have some tests for this.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, I think it's a nice idea! I will try to change code and add tests. 💪

@ybiquitous
Copy link
Member Author

@ntwb Thanks for your reviewing! I fixed your review points, so please review again!

@jeddy3 jeddy3 mentioned this pull request Aug 13, 2018
6 tasks
@jeddy3
Copy link
Member

jeddy3 commented Aug 14, 2018

@ntwb Have your concerns been addressed?

@ntwb
Copy link
Member

ntwb commented Aug 14, 2018

@jeddy3 Yes, thanks a bunch for this @ybiquitous 😄

@ntwb ntwb merged commit 58ac380 into stylelint:master Aug 14, 2018
@ntwb
Copy link
Member

ntwb commented Aug 14, 2018

Changelog update in e327558

Added: unix formatter (#3524).

@ybiquitous
Copy link
Member Author

Thank you, too. 😊

@ntwb
Copy link
Member

ntwb commented Aug 19, 2018

p.s. Welcome to the @stylelint organisation @ybiquitous 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

Add unix-style formatter
4 participants