Skip to content

Standardize process exit codes #570

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

Merged
merged 9 commits into from
Nov 19, 2021
Merged

Conversation

brandenrodgers
Copy link
Contributor

@brandenrodgers brandenrodgers commented Oct 5, 2021

Description and Context

Following up this PR here: #565

We would like to have three different exit codes:

  • 0: A successful run
  • 1: There was a config problem or an internal error
  • 2: There are warnings or validation issues

I'm adding some utils for us to use around the repo to make sure that we're using the exit codes consistently. There are a lot of places that will need to be updated, so I haven't done that yet. I'm showing three different patterns that we could use. I don't feel super strongly about any of them, but I figured I'd check in with everyone before picking one of them.

Here's some more context. This is how the ESLint CLI handles their error codes.

Screenshots

TODO

  • Pick a pattern, and update all the commands to use it

Who to Notify

cc/ @gcorne

@gcorne
Copy link
Contributor

gcorne commented Oct 5, 2021

My preference is the enum with process.exit() because I think it makes it clearer that execution will stop at that point.

@anthmatic
Copy link
Contributor

My preference is the enum with process.exit() because I think it makes it clearer that execution will stop at that point.

I second this

@brandenrodgers brandenrodgers changed the title Showing a few options for standardizing exit codes Standardize process exit codes Oct 29, 2021
Copy link
Contributor

@anthmatic anthmatic left a comment

Choose a reason for hiding this comment

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

Looks good

@brandenrodgers brandenrodgers merged commit 81b20dc into master Nov 19, 2021
@brandenrodgers brandenrodgers deleted the standardize-exit-codes branch November 19, 2021 20:20
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.

4 participants