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

cmd: Change exit status #1191

Merged
merged 1 commit into from
Sep 11, 2021
Merged

cmd: Change exit status #1191

merged 1 commit into from
Sep 11, 2021

Conversation

wata727
Copy link
Member

@wata727 wata727 commented Aug 19, 2021

Fixes #528

Change the exit status to what I originally intended.

Before:

  • 0: No issues found
  • 2: Errors occurred
  • 3: No errors occurred, but issues found

After:

  • 0: No issues found
  • 1: Errors occurred
  • 2: No errors occurred, but issues found

This is clearly a breaking change, but due to its natural behavior, it may be worth accepting.

@bendrucker
Copy link
Member

Seems like the original submission in #528 is focused on setting the exit code based on the issue with the highest severity level. I don't see that as a particularly compelling feature, FWIW.

I'm 👍 for this, few users depend on specific non-zero exit codes anyway. You could hang on to it for a bit and release it with other breaking changes.

@bendrucker
Copy link
Member

Spotted something related to this:

https://golangci-lint.run/usage/configuration/

golangci-lint has an --issues-exit-code flag which defaults to 1. It's been in there for multiple years. Not really sure making this configurable is warranted but it did make me think of this discussion.

@wata727
Copy link
Member Author

wata727 commented Sep 9, 2021

Interesting. I'm not sure why golangci-lint offers this as a configurable option, but at least in my opinion, it doesn't seem necessary to do that. I can't find any problems that cannot be solved unless they can be configurable.

@wata727 wata727 merged commit d18de0b into master Sep 11, 2021
@wata727 wata727 deleted the change_exit_status branch September 11, 2021 13:45
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.

'Warning' exit status is 3 instead of 2
2 participants