chrismair / GrailsCodeNarcPlugin

Grails CodeNarc plugin
Apache License 2.0
10 stars 5 forks source link

How to fail Grails build on error? #24

Closed nkovalenko93 closed 4 years ago

nkovalenko93 commented 4 years ago

I have a Grails application. I run "grails codenarc". I want to fail process after report is generated if there are some errors.

How to do this? My process is always finishes successfully even there are a lot of errors.

chrismair commented 4 years ago

Looks like this will require a code change, to expose the CodeNarc Ant Task failOnError config property. But I agree that is worth doing.

nkovalenko93 commented 4 years ago

Can I help you with that? I tried to make a pull request but I have no enough responsibilities to create branch in your repository.

chrismair commented 4 years ago

I think you need to fork the repo first and then create the pull request: https://help.github.com/en/github/collaborating-with-issues-and-pull-requests/creating-a-pull-request-from-a-fork

nkovalenko93 commented 4 years ago

Oh, I could just make this:

codenarc.maxPriority1Violations=0 // Maximum of 1-level errors to not to fail build
codenarc.maxPriority2Violations=10 // Maximum of 2-level errors to not to fail build
codenarc.maxPriority3Violations=20 // Maximum of 3-level errors to not to fail build
chrismair commented 4 years ago

Ugh, yes, I should have remembered that. No need for a code change.