Product Area
The "code-analyzer" CLI
Your Need or Problem
Currently, in order to exclude specific folders (such as test code) from PMD scanning, we must create a custom PMD ruleset and add entries.
However, this means we can no longer directly use Salesforce’s official rulesets (like the AppExchange rules). As a result, we lose the ability to automatically pick up new or updated rules when Salesforce updates its default rulesets.
Use Case
• We want to continue running sf code-analyzer run --rule-selector AppExchange to always benefit from the latest Salesforce-provided rules.
• At the same time, we need to exclude entire folders (e.g., /tests/, /mocks/) from being analyzed, without modifying or duplicating the official rulesets.
Your Desired Solution
Allow users to provide a global ignore list of folders/files (similar to .eslintignore) in code-analyzer.yml or via a CLI flag. This ignore list should be respected even when running Salesforce official rulesets such as --rule-selector AppExchange.
Alternatives Considered
No response
Additional Context (Screenshots, Files, etc)
No response
Workaround
No response
Urgency
Low