You can use the codenarc plugin to check your gsp pages / files.
Just install
codenarc.processViews = true
in your BuildConfig.groovy file, and they will be included in the code character checks.
Here is an example of setting code in BuildConfig.groovy
codenarc.processTestUnit = false codenarc.processTestIntegration = false codenarc.processViews = true codenarc.propertiesFile = 'grails-app/conf/codenarc.properties' codenarc.ruleSetFiles = [ "rulesets/basic.xml", "rulesets/braces.xml", "rulesets/grails.xml", "rulesets/groovyism.xml", ]
Here we also define the external codenarc.properties file, which we use to enable / disable parts of the rules from each included set of rules. An example codenarc.properties file codenarc.properties here:
# some gsp MUST have embedded CSS and/or embedded Javascript which requires the use of semicolons. UnnecessarySemicolon.doNotApplyToFileNames = *.gsp
Hope that helps
Tom
dawogfather
source share