Skip to content

[Feature Request] Deactivate a rule without writing a custom ruleset #1985

@dschach

Description

@dschach

Product Area

The "code-analyzer" CLI

Your Need or Problem

I want to use PMD rules with Code Analyzer, and I want to ignore a specific rule. Let's call it MyRule. If I generate a code-analyzer.yml configuration file and list all the rules, and if I delete the rule called MyRule from the YAML, my code is still flagged because the engine assumes I want the default rules all run at default severity. There is, simply, no way to ask Code Analyzer NOT to run any of the default rules.

But what I really want to do is to set a rule so that it is ignored.

I have accomplished this by writing my own PMD rule configuration XML file, but that's not really sustainable (though it does let me pass parameters, so part of me thinks that might be better long-term... but that's way too complicated for someone starting out. And it's not easy for a beginner to create a configuration file for PMD, let alone ESLint, sfge, etc.

Your Desired Solution

I want to set a rule priority to 0 in the configuration file, which will make the engine ignore it.

Alternatives Considered

I could make special rule files for ESlint, PMD, and ... oh, wait, I can't do that for sfge, regex, retire-js, etc.

I could make "shadow" tags for the existing rules, and then only run the tags that I want to run, but that's such a big workaround.

Additional Context (Screenshots, Files, etc)

No response

Workaround

For some engines, I can abandon the YAML configuration, but then I lose the tags/categories, and I like those. For others... it's all or nothing.

Urgency

Low

Metadata

Metadata

Assignees

No one assigned

    Labels

    RoadmapThis item is available in our roadmap

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions