FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

PSReservedParams: Make severity Error instead of Warning by liamjpeters · Pull Request #1989 · PowerShell/PSScriptAnalyzer · GitHub

PSReservedParams: Make severity Error instead of Warning - #1989

Merged
Andy Jordan (andyleejordan) merged 2 commits into
PowerShell:mainfrom
liamjpeters:#1973PSReservedParamsGeneratesWarningInsteadOfError
Feb 20, 2025
Merged

PSReservedParams: Make severity Error instead of Warning#1989
Andy Jordan (andyleejordan) merged 2 commits into
PowerShell:mainfrom
liamjpeters:#1973PSReservedParamsGeneratesWarningInsteadOfError

Conversation

Copy link
Copy Markdown
Contributor

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

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

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.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Thanks!

/// Gets the severity of the returned diagnostic record: error, warning, or information.
/// </summary>
/// <returns></returns>
public DiagnosticSeverity GetDiagnosticSeverity()

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Why do we need a whoel function for this?

Andy Jordan (andyleejordan) merged commit 5648cf5 into PowerShell:main Feb 20, 2025
Liam Peters (liamjpeters) deleted the #1973PSReservedParamsGeneratesWarningInsteadOfError branch February 21, 2025 11:51
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Rule PSReservedParams generates Warning instead of Error

3 participants


Back | FazBrowse Home | New Git URL