Skip to content

[Feature Request] Allow ignoring folders/files while using Salesforce official PMD rulesets (e.g. AppExchange) #1898

@jairzh

Description

@jairzh

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    USER STORYNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions