- Notifications
You must be signed in to change notification settings - Fork407
Backport MSDocs changes#2085
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
…ocs were present (e.g. in UseShouldProcessForStateChangingFunctions), replaced with the live URLs. Did not port back TODO block of AvoidAssignmentToAutomaticVariable.md fromhttps://github.com/MicrosoftDocs/PowerShell-Docs-Modules/pull/241/files#diff-1db3dc2f98da1fa58e24bac28ea9f14f507c78d8299349aa0196f01f9479b6f5Backported PRs:-https://github.com/MicrosoftDocs/PowerShell-Docs-Modules/pull/281/files-MicrosoftDocs/PowerShell-Docs-Modules@ff80de6-https://github.com/MicrosoftDocs/PowerShell-Docs-Modules/pull/275/files-MicrosoftDocs/PowerShell-Docs-Modules#278-https://github.com/MicrosoftDocs/PowerShell-Docs-Modules/pull/235/files-https://github.com/MicrosoftDocs/PowerShell-Docs-Modules/pull/276/files-MicrosoftDocs/PowerShell-Docs-Modules#273-MicrosoftDocs/PowerShell-Docs-Modules#285-MicrosoftDocs/PowerShell-Docs-Modules@6ca872b#diff-b3e50d455fe1b464a6fec38ac616cbde4a412766a05a606c1ae55be90ccb63a3-MicrosoftDocs/PowerShell-Docs-Modules#277
sdwheeler commentedMar 15, 2025
@bergmeister I had changes in flight for this already and my changes had a few things you missed. I added my changes to this PR. |
sdwheeler left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
LGTM
Uh oh!
There was an error while loading.Please reload this page.
| <!-- TODO | ||
| Ability to suppress was added in https://github.com/PowerShell/PSScriptAnalyzer/pull/1896 | ||
| Need documentation for how to configure suppression of this rule. | ||
| --> | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
In my original PR I left this out because this comment relates more to work in MSDocs. Maybe a GitHub issue is a better place for it than a comment?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
We should add this information in both repos before release. I couldn't figure out how to configure this. Can you provide an example?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Suppression is not different that any other rule. For example[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidAssignmentToAutomaticVariable', '')] suppresses the rule and[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidAssignmentToAutomaticVariable', 'PID')] makes the suppression specific to assignment to$PID automatic variable
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Can you only do this in code? Other rules can be configured using JSON. For example:https://learn.microsoft.com/powershell/utility-modules/psscriptanalyzer/rules/usesingularnouns#configuration
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Suppression is only possible via annotating code with this attribute unless one decided to not run rule at all via PSSA settings but I wouldn't call that suppression:https://learn.microsoft.com/en-us/powershell/utility-modules/psscriptanalyzer/using-scriptanalyzer?view=ps-modules#suppressing-rules
What you reference is rule configuration as part of PSSA settings, which is not JSON, it's PowerShell's hashtable format:https://learn.microsoft.com/en-us/powershell/utility-modules/psscriptanalyzer/using-scriptanalyzer?view=ps-modules#settings-support-in-scriptanalyzer
Co-authored-by: Christoph Bergmeister <c.bergmeister@gmail.com>
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Co-authored-by: Christoph Bergmeister <c.bergmeister@gmail.com>
28081e5 intoPowerShell:mainUh oh!
There was an error while loading.Please reload this page.
andyleejordan commentedMar 19, 2025
@sdwheeler@bergmeister this seems to have removed some information from#1704 for |
sdwheeler commentedMar 19, 2025
I have had so many issues with the docs branches. I had a draft update for UserCorrectCasing.md that has gone missing. Let me see if I can find it and update again. |
Uh oh!
There was an error while loading.Please reload this page.
PR Summary
UseShouldProcessForStateChangingFunctions), replaced with the live URLs.Backported PRs:
PR Checklist
.cs,.ps1and.psm1files have the correct copyright headerWIP:to the beginning of the title and remove the prefix when the PR is ready.