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

Breaking: use an exit code of 2 for fatal config problems (fixes #9384) #10009

Merged
merged 2 commits into from Mar 22, 2018

Conversation

Projects
4 participants
@not-an-aardvark
Member

not-an-aardvark commented Feb 23, 2018

What is the purpose of this pull request? (put an "X" next to item)

[x] Other, please explain:

What changes did you make? (Give an overview)

This updates the CLI to use an exit code of 2 for configuration errors or crashes. As described in #9384, this is useful for integrations to distinguish between successful lint runs with errors and unsuccessful lint runs.

Is there anything you'd like reviewers to focus on?

Nothing in particular

@platinumazure

Question: What exit code are we using for invalid CLI options? (My hope is 2, my fear is 0.)

ESLint will exit with one of the following exit codes:
* `0`: Linting was successful and there are no linting errors. If the `--max-warnings` flag is set to `n`, the number of linting warnings is at most `n`.

This comment has been minimized.

@platinumazure

platinumazure Feb 24, 2018

Member

I'm not sure this is valuable but I'm throwing it out anyway: Should we explicitly note that --help or --version returns exit code of 0?

This comment has been minimized.

@not-an-aardvark

not-an-aardvark Feb 24, 2018

Member

This is also the case for other flags like --init and --print-config. Maybe I could add a qualifier that these exit codes only apply when ESLint is used to lint files.

@not-an-aardvark

This comment has been minimized.

Member

not-an-aardvark commented Feb 24, 2018

Question: What exit code are we using for invalid CLI options? (My hope is 2, my fear is 0.)

@not-an-aardvark not-an-aardvark merged commit e4c3b3c into master Mar 22, 2018

5 checks passed

commit-message PR title follows commit message guidelines
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
licence/cla Contributor License Agreement is signed.
Details
release-monitor No patch release is pending
Details

v5.0.0 automation moved this from Ready to merge to Done Mar 22, 2018

@not-an-aardvark not-an-aardvark deleted the separate-exit-code branch Mar 22, 2018

@eslint eslint bot locked and limited conversation to collaborators Sep 19, 2018

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.