-
Notifications
You must be signed in to change notification settings - Fork 391
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
Backport MSDocs changes #2085
Backport MSDocs changes #2085
Conversation
…ocs were present (e.g. in UseShouldProcessForStateChangingFunctions), replaced with the live URLs. Did not port back TODO block of AvoidAssignmentToAutomaticVariable.md from https://github.com/MicrosoftDocs/PowerShell-Docs-Modules/pull/241/files#diff-1db3dc2f98da1fa58e24bac28ea9f14f507c78d8299349aa0196f01f9479b6f5 Backported 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
7543854
to
fbf2905
Compare
@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. |
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
<!-- 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>
Co-authored-by: Christoph Bergmeister <c.bergmeister@gmail.com>
@sdwheeler @bergmeister this seems to have removed some information from #1704 for |
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. |
PR Summary
UseShouldProcessForStateChangingFunctions
), replaced with the live URLs.Backported PRs:
PR Checklist
.cs
,.ps1
and.psm1
files have the correct copyright headerWIP:
to the beginning of the title and remove the prefix when the PR is ready.