The CodeNarc plugin provides static code analysis using CodeNarc library. CodeNarc analyzes Groovy code for defects, bad practices, inconsistencies, style issues etc. CodeNarc provides a Groovy DSL for defining RuleSets.
Install CodeNarc plugin into you grails project. Now create one groovy file say CustomRules.groovy and add following code into it.
SystemOutPrint //these are the rules from CodeNarc library
Now add location of this file in Config.properties
and you are done with configuring custom rule, Now you can run codenarc for configured rule.
Hope this helps