Normally in gradle I have codenarc setup with most rules turned on.
codenarc {
ignoreFailures = true
configFile = file 'config/codenarc/codenarc.groovy'
}
I was able to get violations down, in the main source set, to a very small number and I would like to set the max violations and allow codenarc to fail the build when violations are added to the project.
codenarc {
configFile = file 'config/codenarc/codenarc.groovy'
maxPriority1Violations = 0
maxPriority2Violations = 2
maxPriority3Violations = 1
}
My problem is codenarcTest has tons of violations. I tried setting codenarcTest to ignore failures with this:
condenarcTest {
ignoreFailures = true
}
Gradle cannot configure the task in this way for some reason.
A problem occurred evaluating root project 'graph-dsl'.
> Could not find method condenarcTest() for arguments [build_9wxt0rbmoonofvrk71q96y4et$_run_closure5@6fb2b7b4] on root project 'graph-dsl' of type org.gradle.api.Project.
How can I setup codenarcTest to ignoreFailures and codenarcMain to not ignoreFailures?