Grails - See the Grails CodeNarc Plugin for Grails 2.x. Use the the Gradle CodeNarc Plugin for Grails 3.x and later. Also see Static code analysis in a Grails app with CodeNarc.
NPM Groovy Lint - NPM CodeNarc wrapper to easily lint, format and fix Groovy files and Jenkinsfile via command line. Uses CodeNarc for its static analysis of Groovy source code.
Grails (and possibly other tools integrating with CodeNarc) can benefit from using the current thread context
ClassLoader for loading rule script files, rather than the default base
ClassLoader. Setting the
“codenarc.useCurrentThreadContextClassLoader” system property to “true” uses the current thread context
ClassLoader for loading rule script files. That enables Grails to load rule script files from within
the Grails project, and allows those rule scripts to reference local classes. See
Grails CodeNarc Plugin automatically sets that system property.