PowerShell / PowerShell/PSScriptAnalyzer
Diagnostics.CodeAnalysis.SuppressMessageAttribute should take an array of category names
Offen
@kapilmb arbeitet bereits daran.
Seit 07.3.2016.
Issue - Enhancement
- Vorherrschende Sprache
- C#
- Sterne
- 2.2k
- Forks
- 414
- Ø Merge
- 13 Std. 1 Min.
- Gemergte PRs (30 T.)
- 2
Beschreibung
The attribute needs to take an array of categories. I shouldn't have to add a new instance of the attribute for each category I want to suppress.
Having to write a separate line for every rule I need to suppress is extremely frustrating and verbose. Take for example this 2 line internal function:
function New-PSCredential {
[Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSAvoidUsingPlainTextForPassword")] # It's encoded, leave me alone
[Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSAvoidUsingUserNameAndPasswordParams")] # That's the whole point of this function
[Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSProvideCommentHelp")] # No point for a constructor function with parameters this simple
[Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSProvideDefaultParameterValue")] # No point for internal functions
[Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSUseOutputTypeCorrectly")] # No point for internal functions
param([string]$UserName, [string]$EncodedPassword)
New-Object PSCredential $UserName, (ConvertTo-SecureString $EncodedPassword)
}
Seriously?
Beitragsleitfaden
Erste Schritte
- Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
- Forke das Repository und arbeite in einem Branch.
- Öffne einen Pull Request, der die Issue-Nummer nennt.
Bewertung
Dieses Issue wurde noch nicht bewertet.