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

add option to return not 0 status code if any issues found #27

Closed
bekinin opened this issue Jul 14, 2014 · 5 comments
Closed

add option to return not 0 status code if any issues found #27

bekinin opened this issue Jul 14, 2014 · 5 comments
Assignees

Comments

@bekinin
Copy link

bekinin commented Jul 14, 2014

I am using pronto in CI and I miss one feature to mark build as failed if any issues found in pronto run.

So, it would be great to add some command, which would set status code as not zero, if any issues found, so that CI would fail the build.

@mmozuras
Copy link
Member

@bekinin I feel that it would be weird to return non-zero error status if command successfully completes the job it was meant to do. Do you have a more exact suggestion on how could it work?

Also, what about using some unix magic for the job? Something with wc -l should work:

exit $(pronto run | wc -l)

@mmozuras mmozuras self-assigned this Jul 20, 2014
@bekinin
Copy link
Author

bekinin commented Jul 20, 2014

@mmozuras here is my usage scenario, which I want to implement with pronto.

  • developer did some changes in pull request
  • CI server run pronto and check code styles and others runners.
  • pronto comment in github pull request with all issues
  • pronto fail CI build if any issues exist e.g. not pass code policy.
  • CI mark pull request as "not able to merge" due failed CI build

So, all works for me now except failing CI build on pronto run.

Yes, I can use workaround and some unix magic, but that's force me to run pronto twice, one time for github comments and second time to fail CI build with wc, which is not good.

So, I was thinking on some option in github mode, which would set result code as amount of issues found, similar to rails_best_practices gem

@lwoodson
Copy link

+1 on this request for the exact same reasons as stated by @bekinin. Maybe make it a command line option? --fail-on-detection

@mmozuras
Copy link
Member

@bekinin @lwoodson 👍 I will include something similar to --fail-on-detection/--fail in the next release.

mmozuras added a commit that referenced this issue Aug 10, 2014
With it, pronto exits with non-zero code if there were any
warnings/errors.

Resolves #27
@mmozuras
Copy link
Member

Released --exit-code as part of 0.3.0. Currently going through pronto- runners and making sure they are compatible with the newest version.

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

No branches or pull requests

3 participants