Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Include Issues on Multiple Criteria

Inclusions allow you to ignore everything but a certain pattern. Say that your profile includes the Magic Number rule, which but you only want it to run against files with Bean in the name. Inclusions give you the ability to do that. In essence, they allow a negative exclusion pattern. Here's one way to think of it: exclude Magic

exclude Magic Number on ![**/*Bean.java]

Which means, that Magic Number will be executed on files that end with Bean, but no others. Of course, the Examplesthe actual syntax is a bit different.

Use cases:

  • I just want to check the rule Magic Number on Bean objects => **/*Bean.java;checkstyle:com.puppycrawl.tools.checkstyle.checks.coding.MagicNumberCheck;*
  • I just want to check for issues on COBOL programs located in directories bank/creditcard and bank/bankcard => two criteria to define: bank/creditcard/**/*;*;*   and  bank/bankcard/**/*


<TODO> Update the screenshot

...