There is a property called doNotApplyToClassNames that you can use to omit those classes you don't want to be inspected for a given CodeNarc rule.
If you want to use it you will only have to put the name of the rule followed by the doNotApplyToClassNames literal and the specify the names of the classes you don´t want to be inspected for that particular rule.
NameOfTheRule.doNotApplyToClassNames="ClassOne, ClassTwo"
In this particular situation I didn't want CodeNarc to bother me about the lack of equals and hashcode methods in those domain classes so I wrote the following lines in my CodeNarc configuration (inside BuildConfig.groovy)
GrailsDomainHasEquals.doNotApplyToClassNames="Role, User, UserRole" GrailsDomainHasToString.doNotApplyToClassNames="Role, User, UserRole"
Here's the codenarc closure configuration:
codenarc.properties = { GrailsPublicControllerMethod.enabled = false GrailsDomainHasEquals.doNotApplyToClassNames="Role, User, UserRole" GrailsDomainHasToString.doNotApplyToClassNames="Role, User, UserRole" }
Hola! Buenísimo el tip, pero ¿conocés alguna forma de excluir de todas las reglas ciertos archivos? Quiero excluir, por ejemplo, el LoginController de todas las reglas (estoy usando Spring Security).
ReplyDeleteGracias!
ERPTREE handles oracle fusion HCM training and its modules maintaining classroom based training with
ReplyDeletethe self-paced videos. An expert having ten plus years of self-experience handles the training period through online and explains each and every point perfectly. We recently launched our institute in the USA and getting the best reputation over there.
Oracle fusion HCM Online Training
Oracle Fusion HCM Training