PSReservedParams: Make severity Error instead of Warning by liamjpeters · Pull Request #1989 · PowerShell/PSScriptAnalyzer
PR Summary
PSScriptAnalyzer reports PSReservedParams as warning but according to the documentation it's an error.
This PR makes the rule report as an error and fixes up tests that expect there to be 7 rules with an error severity (this makes it 8).
Resolves #1973
PR Checklist
- PR has a meaningful title
- Use the present tense and imperative mood when describing your changes
- Summarized changes
- Change is not breaking
- Make sure all
.cs,.ps1and.psm1files have the correct copyright header - Make sure you've added a new test if existing tests do not effectively test the code changed and/or updated documentation
- This PR is ready to merge and is not Work in Progress.
- If the PR is work in progress, please add the prefix
WIP:to the beginning of the title and remove the prefix when the PR is ready.
- If the PR is work in progress, please add the prefix
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, I think it's best to fix the code like you did rather than documentation because for this rule, violations result in code that won't even run.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
| /// Gets the severity of the returned diagnostic record: error, warning, or information. | ||
| /// </summary> | ||
| /// <returns></returns> | ||
| public DiagnosticSeverity GetDiagnosticSeverity() |
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we need a whoel function for this?
liamjpeters
deleted the
#1973PSReservedParamsGeneratesWarningInsteadOfError
branch