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

Fix errors in ShouldProcess rule document #1766

Merged
merged 7 commits into from
Mar 30, 2022

Conversation

masaru-iritani
Copy link
Contributor

PR Summary

  • Fix wrong variable names in examples.
  • Remove Write-Host from the correct example. It is duplicated with outputs of -WhatIf or -Confirm. It also violates "Avoid Using Write-Host" rule.
  • Correct the severity of ShouldProcess rule as mentioned in ShouldProcess.md. Get-ScriptAnalyzerRule -Name PSShouldProcess | % Severity also returns "Warning" with ScriptAnalyzer 1.20.0

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, .ps1 and .psm1 files 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.
  • Update examples can run successfully on PowerShell 7.2.1.
  • Script Analyzer 1.20.0 detects a ShouldProcess violation in the updated wrong example. For some reason, Script Analyzer 1.20.0 doesn't detect any ShouldProcess violation in the updated wrong example.
  • Script Analyzer 1.20.0 detects no error in the updated correct example.

@bergmeister bergmeister self-assigned this Jan 23, 2022
@bergmeister bergmeister self-requested a review January 23, 2022 20:40
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.

Awesome, thank you for the effort and very detailed description 🥳
@sdwheeler I am happy from a technical perspective, do you want to review the docs change as well before merging?

docs/Rules/README.md Show resolved Hide resolved
Copy link
Collaborator

@sdwheeler sdwheeler left a comment

Choose a reason for hiding this comment

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

One minor change to link to about_* topics.

@masaru-iritani
Copy link
Contributor Author

One minor change to link to about_* topics.

Updated as suggested. Would you review it again and resolve the request? I cannot find any way to resolve this thread by myself.

@bergmeister
Copy link
Collaborator

@sdwheeler Can you re-review please? You can contact @JamesWTruher to get it merged as the left-over check doesn't seem to go away when pulling in master.

@bergmeister
Copy link
Collaborator

Thanks @sdwheeler, can you resolve the merge conflict please and then we are good to merge 💪🏻

@bergmeister bergmeister enabled auto-merge (squash) March 29, 2022 22:56
@JamesWTruher JamesWTruher merged commit da59807 into PowerShell:master Mar 30, 2022
@masaru-iritani masaru-iritani deleted the patch-1 branch April 2, 2022 06:51
@PowerShell PowerShell deleted a comment from Toomani May 11, 2022
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.

None yet

4 participants