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

Fix exit status when rubocop is interrupted #6436

Merged
merged 1 commit into from Nov 1, 2018
Merged

Fix exit status when rubocop is interrupted #6436

merged 1 commit into from Nov 1, 2018

Conversation

deivid-rodriguez
Copy link
Contributor

@deivid-rodriguez deivid-rodriguez commented Oct 31, 2018

I wanted to resume the work I started on #5808, but I noticed a small issue with the status code rubocop has when interrupted. If you type Ctrl-C while rubocop is running, it will have an exit status of "1", which in rubocop's domain means "offenses were detected". However, this is not accurate since one may interrupt rubocop without any offenses having yet been detected (for example, because it will take too long to run).

So I changed the status code in this situation to be 130, which is a common practice for scripts. See for example https://stackoverflow.com/a/40484670/143243.


Before submitting the PR make sure the following are checked:

  • Wrote good commit messages.
  • Commit message starts with [Fix #issue-number] (if the related issue exists).
  • Feature branch is up-to-date with master (if not - rebase it).
  • Squashed related commits together.
  • Added tests.
  • Added an entry to the Changelog if the new code introduces user-observable changes. See changelog entry format.
  • The PR relates to only one subject with a clear title
    and description in grammatically correct, complete sentences.
  • Run rake default. It executes all tests and RuboCop for itself, and generates the documentation.

@koic koic merged commit c5a8470 into rubocop:master Nov 1, 2018
@koic
Copy link
Member

koic commented Nov 1, 2018

Superb! Thanks a lot.

@deivid-rodriguez deivid-rodriguez deleted the fix_interrupted_exit_status branch November 1, 2018 13:07
@deivid-rodriguez
Copy link
Contributor Author

Thanks to you! 👍

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.

None yet

3 participants