Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Linters: ability to configure the "default" level for new analyzers #10304

Open
anthony-c-martin opened this issue Apr 3, 2023 · 2 comments
Open
Assignees
Labels
devdiv Related to Bicep tooling efforts in DevDiv enhancement New feature or request P1 This is planned to be completed before the end of a release story: linter

Comments

@anthony-c-martin
Copy link
Member

Problem Statement

If a new analyzer is added, it generally will be added with a level of "warning". Once the rule has been added, it's possible to upgrade the level to "error" with the following:

{
    "analyzers": {
        "core": {
            "rules": {
                "my-new-rule": {
                    "level": "error"
                }
            }
        }
    }
}

However, this is only possible to do after the rule has been added. There's no way possible to default all new linter rules to "error".

Suggestion

Something like the following would be nice, for users wanting to be ultra strict with their build process:

{
    "analyzers": {
        "defaults": {
            "level": "error"
        },
        "core": {
            "rules": {
                "rule-with-warning-override": {
                    "level": "warning"
                }
            }
        }
    }
}

It may also be useful to have the ability to block certain rules from being overridden in-line:

{
    "analyzers": {
        "defaults": {
            "level": "error",
            "allow-inline-disable": false
        },
        "core": {
            "rules": {
                "rule-with-warning-override": {
                    "level": "warning",
                    "allow-inline-disable": true
                }
            }
        }
    }
}
@StephenWeatherford
Copy link
Contributor

StephenWeatherford commented Apr 3, 2023

@anthony-c-martin Thanks for entering. I suggested exactly this here, and also in a community call, but saw very little interest.

image

However, the main reason I haven't impemented the current proposal in #8013 is that I'm convinced we do need the capability to deal with this and also builds breaking caused by new rules. I'll spend some time soon getting a final proposal together. Would like to get this out of the way.

It may also be useful to have the ability to block certain rules from being overridden in-line:

This was actually requested by BMoore and is tracked here: #5377, will add your comments there.

@StephenWeatherford
Copy link
Contributor

Related to #4719

@StephenWeatherford StephenWeatherford added the P1 This is planned to be completed before the end of a release label May 3, 2023
@puicchan puicchan modified the milestones: v0.18, v0.19 May 3, 2023
@puicchan puicchan modified the milestones: v0.19, v0.20 May 25, 2023
@puicchan puicchan modified the milestones: v0.20, v0.21 Jul 6, 2023
@puicchan puicchan added P2 This is important to be completed, but you may not get to it and removed P1 This is planned to be completed before the end of a release labels Aug 1, 2023
@StephenWeatherford StephenWeatherford modified the milestones: v0.21, 0.22 Aug 28, 2023
@puicchan puicchan removed the P2 This is important to be completed, but you may not get to it label Aug 29, 2023
@puicchan puicchan modified the milestones: v0.22, v0.23 Aug 29, 2023
@puicchan puicchan added the P1 This is planned to be completed before the end of a release label Aug 29, 2023
@puicchan puicchan modified the milestones: v0.23, v0.24 Oct 5, 2023
@puicchan puicchan modified the milestones: Committed Backlog, v0.28 Mar 20, 2024
@puicchan puicchan modified the milestones: v0.28, v0.27 Apr 4, 2024
@StephenWeatherford StephenWeatherford modified the milestones: v0.27, v0.28 Apr 29, 2024
@puicchan puicchan modified the milestones: v0.28, v0.29 May 9, 2024
@puicchan puicchan modified the milestones: v0.29, v0.30 Jun 7, 2024
@puicchan puicchan added P1 This is planned to be completed before the end of a release and removed P1 This is planned to be completed before the end of a release labels Jul 9, 2024
@puicchan puicchan modified the milestones: v0.30, v0.31 Jul 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
devdiv Related to Bicep tooling efforts in DevDiv enhancement New feature or request P1 This is planned to be completed before the end of a release story: linter
Projects
Status: Todo
Development

No branches or pull requests

3 participants