Skip to content

Grouping Rules

Jon Schneider edited this page May 11, 2016 · 1 revision

You may also group individual rules together with an additional properties file. Suppose in addition to the fix-jersey-bundle' rule we just created, we also provided a rule for fix-something-else`.

If we want to apply both rules to a build script, we could do something like:

gradleLint.rules = ['fix-jersey-bundle', 'fix-something-else']

Alternatively, we could provide a properties file called META-INF/lint-rules/fix-all.properties with the contents:

includes=fix-jersey-bundle,fix-something-else

Then we can apply both rules at once:

gradleLint.rules = ['fix-all']

The includes list can refer to other rule groups as well, and in this way you can compose together larger and larger sets of rules incrementally.