Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PSReservedParams: Make severity Error instead of Warning #1989

Conversation

liamjpeters
Copy link
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
Collaborator

@bergmeister bergmeister left a comment

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.

Copy link
Member

@andyleejordan andyleejordan left a comment

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()
Copy link
Member

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?

@andyleejordan andyleejordan enabled auto-merge (squash) February 20, 2025 22:55
@andyleejordan andyleejordan merged commit 5648cf5 into PowerShell:main Feb 20, 2025
4 checks passed
@liamjpeters liamjpeters deleted the #1973PSReservedParamsGeneratesWarningInsteadOfError branch February 21, 2025 11:51
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