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

v1.13.0 erroneously reports non-zero exit code #4599

Closed
FND opened this issue May 30, 2018 · 2 comments
Closed

v1.13.0 erroneously reports non-zero exit code #4599

FND opened this issue May 30, 2018 · 2 comments
Assignees
Labels
area:cli Issues with Prettier's Command Line Interface locked-due-to-inactivity Please open a new issue and fill out the template instead of commenting. status:has pr Issues with an accompanying pull request. These issues will probably be fixed soon! type:bug Issues identifying ugly output, or a defect in the program

Comments

@FND
Copy link

FND commented May 30, 2018

reduced test case:

$ prettier *.js --debug-check --list-different
  • with v1.12.1, this reports exit status 0 if the code is properly formatted
  • with v1.13.0, this reports exit status 1 even though the code is properly formatted

original test case: https://gist.github.com/FND/8cdcc6c60bd5430b2204fe930acc3eec/revisions

with v1.12.1, the following works as expected:

  1. actively reformat source code:

    $ prettier --write *.js
    
  2. ensure source code is formatted properly (e.g. as part of the test suite, continuous integration etc.):

    $ prettier --write *.js --debug-check --list-different --no-write
    

    here --no-write overrides --write, which is useful because we don't have to modify Add testing #1's base command - particularly in package.json:

    "scripts": {
        "test": "npm run format -- --debug-check --list-different --no-write",
        "format": "prettier --write '*.js'"
    }

however, with v1.13.0, that second command fails with exit code 1, despite the source code being properly formatted

@ikatyang ikatyang added type:bug Issues identifying ugly output, or a defect in the program area:cli Issues with Prettier's Command Line Interface labels May 30, 2018
@ikatyang ikatyang self-assigned this May 30, 2018
@ikatyang ikatyang added the status:has pr Issues with an accompanying pull request. These issues will probably be fixed soon! label May 30, 2018
@FND
Copy link
Author

FND commented May 30, 2018

Wow, that was quick - thanks a lot, @ikatyang!

@duailibe
Copy link
Member

This is fixed in 1.13.3.

@lock lock bot added the locked-due-to-inactivity Please open a new issue and fill out the template instead of commenting. label Aug 28, 2018
@lock lock bot locked as resolved and limited conversation to collaborators Aug 28, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area:cli Issues with Prettier's Command Line Interface locked-due-to-inactivity Please open a new issue and fill out the template instead of commenting. status:has pr Issues with an accompanying pull request. These issues will probably be fixed soon! type:bug Issues identifying ugly output, or a defect in the program
Projects
None yet
Development

No branches or pull requests

3 participants