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

Program should exit with nonzero code for scripting #2

Merged
merged 1 commit into from
Oct 19, 2014
Merged

Program should exit with nonzero code for scripting #2

merged 1 commit into from
Oct 19, 2014

Conversation

nickcampbell18
Copy link
Contributor

1 is better than zero.

This allows trivial git hooks, such as:

# .git/hooks/pre-commit
rubocop-git --cached

The git commit will then abort if you haven't met the rubocop style guidelines.

m4i added a commit that referenced this pull request Oct 19, 2014
Program should exit with nonzero code for scripting
@m4i m4i merged commit adcdb8b into m4i:master Oct 19, 2014
@m4i
Copy link
Owner

m4i commented Oct 19, 2014

thx!
0.0.5 released.

@hidde-jan
Copy link

Maybe you could also exit with exit(violations.count), i.e. the number of violations. This way it exits with zero if everything is ok and nonzero otherwise. The exit code can then be easily used in other scripts.

@hidde-jan
Copy link

... To show the number of violations. Sorry, can't edit comments on mobile, it seems.

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.

3 participants