bicep
bicep copied to clipboard
Linters: ability to configure the "default" level for new analyzers
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
}
}
}
}
}
@anthony-c-martin Thanks for entering. I suggested exactly this here, and also in a community call, but saw very little interest.

However, the main reason I haven't impemented the current proposal in https://github.com/Azure/bicep/issues/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: https://github.com/Azure/bicep/issues/5377, will add your comments there.
Related to https://github.com/Azure/bicep/issues/4719