Skip to content

Disabling rules in code-analyzer.yml and suppressing PMD Apex via // NOPMD comments #1799

Closed Answered by stephen-carter-at-sf
SCWells72 asked this question in Q&A
Discussion options

You must be logged in to vote

The code-analyzer.yml file is just an overrides file. If something is not present in that file then the defaults are used.

Use the sf code-analyzer rules --rule-selector <YOUR_RULE_SELECTOR> command to see the rules that you have selected. Once you are happy then use the same --rule-selector for your run command.

Note that the default value for --rule-selector on the run and rules command is Recomended. So if you don't want a rule to run with this default selector, then in your overrides file - just remove the Recommended tag for that rule.

What are you using for --rule-selector?

The // NOPMD comment works only for PMD engine and should work as documented at https://pmd.github.io/pmd/pmd_…

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@stephen-carter-at-sf
Comment options

@SCWells72
Comment options

Answer selected by stephen-carter-at-sf
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants