Contents
There is a codenarc.groovy
command-line script in the root directory of the project.
It is intended to streamline common development tasks. Currently, it supports a
create-rule
task for creating new CodeNarc rules.
The create-rule
task performs the following steps:
RUNNING
On Unix/Mac, you can run the following from the project root directory:
./codenarc create-rule
On Windows, you can run:
codenarc create-rule
(If Windows is not configured to automatically run *.groovy files,
just can run groovy codenarc create-rule
)
AFTER YOU RUN codenarc create-rule
After you run codenarc create-rule
, finish up the rule implementation, including the following:
Perform the following steps when creating a new rule. See The codenarc Command-line Script. for information on the command-line script that automates a good bit of the boilerplate, as indicated below.
AbstractAstVisitorRule
. [1]AbstractRuleTestCase
. [1]LoadAllPredefinedRuleSetsTest
.codenarc create-rule
script to create the rule. See The codenarc Command-line Script.Please do the following before submitting a pull request or patch:
Run the full CodeNarc test suite. This includes a test called RunCodeNarcAgainstProjectSourceCodeTest
that runs CodeNarc against its own source code (including any code that you have added or changed).
Submit small PRs (typically less than 300 lines). If you need to make more extensive/larger changes, please create an issue describing the overall changes and then create multiple smaller PRs that link to that issue. Respect your reviewers. Why small PRs:
To generate Intellij IDEA files, execute gradle idea