feat: new Bicep linter rule use-parameter-descriptions#20036
feat: new Bicep linter rule use-parameter-descriptions#20036johnlokerse wants to merge 3 commits into
use-parameter-descriptions#20036Conversation
|
Documentation is needed for this |
|
@anthony-c-martin does anyone on the team have time for a review? 😃 |
|
@johnlokerse does it works for types as well? Would be very good if it applies to types as well or if there is separate rule for it. There is one exception for types though - discriminator. for the example below it should not apply as the description for foo is where foo is referenced. If there is description directly on the type it does not appear anywhere. ...
@discriminator('type)
type foo = foo1 | foo2
... |
@slavizh This can be done. I would do it separately from this linter, though, since not everyone wants to put descriptions on properties in types or on the type itself. The same thing applies to variables and outputs if you ask me. Or as another option we introduce a configuration to the new "analyzers": {
"core": {
"rules": {
"use-recent-api-versions": {
"level": "warning",
"maxAllowedAgeInDays": 500
},
"use-descriptions": {
"level": "error",
"variables": false,
"userDefinedTypes": true,
"parameters": true,
"outputs": true
}
}
}
} |
@johnlokerse - the changes in this PR look good to me, but I think it would be a good idea to close on this discussion first - I wouldn't want to release something and then immediately change it. |
Description
This change adds a new Bicep linter rule called
use-parameter-descriptions. Default the rule level isoffbut when set toerrorit checks if the parameter has either the@sys.descriptionor@descriptiondecorator above a parameter. Additionally, it checks if the description is not empty.@anthony-c-martin @stephaniezyen This implements issue #9453 and #5595.
Example Usage
It works through the
bicep lintercommand or using the VSCode extension:Checklist
Microsoft Reviewers: Open in CodeFlow