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

Conversation

4 participants
@ybiquitous
Member

ybiquitous commented Aug 8, 2018

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}.

This comment has been minimized.

@ybiquitous

ybiquitous Aug 8, 2018

Member

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)

@ybiquitous

This comment has been minimized.

Member

ybiquitous commented Aug 9, 2018

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

This comment has been minimized.

@ntwb

ntwb Aug 9, 2018

Member

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.

This comment has been minimized.

@ybiquitous

ybiquitous Aug 9, 2018

Member

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

@ybiquitous

This comment has been minimized.

Member

ybiquitous commented Aug 9, 2018

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

@jeddy3 jeddy3 referenced this pull request Aug 13, 2018

Closed

Release 9.5.0 #3511

6 of 6 tasks complete
@jeddy3

This comment has been minimized.

Member

jeddy3 commented Aug 14, 2018

@ntwb Have your concerns been addressed?

@ntwb

ntwb approved these changes Aug 14, 2018

@ntwb

This comment has been minimized.

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

3 checks passed

continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
coverage/coveralls Coverage increased (+0.02%) to 96.088%
Details
@ntwb

This comment has been minimized.

Member

ntwb commented Aug 14, 2018

Changelog update in e327558

Added: unix formatter (#3524).

@ybiquitous

This comment has been minimized.

Member

ybiquitous commented Aug 14, 2018

Thank you, too. 😊

@ybiquitous ybiquitous deleted the ybiquitous:add-unix-formatter branch Aug 14, 2018

@ntwb

This comment has been minimized.

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