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

Backport MSDocs changes #2085

Merged
merged 5 commits into from
Mar 17, 2025
Merged

Conversation

bergmeister
Copy link
Collaborator

@bergmeister bergmeister commented Mar 15, 2025

PR Summary

Backported PRs:

PR Checklist

@bergmeister bergmeister changed the title Backport MSDmsdocs changes. Where references to files in MSD… Backport MSDocs changes Mar 15, 2025
@bergmeister bergmeister added the Area - Documentation Backport Backport of docs changes in PowerShell-Docs-Modules repo label Mar 15, 2025
@sdwheeler
Copy link
Collaborator

@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.

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.

LGTM

Comment on lines +19 to +23
<!-- TODO
Ability to suppress was added in https://github.com/PowerShell/PSScriptAnalyzer/pull/1896
Need documentation for how to configure suppression of this rule.
-->

Copy link
Collaborator Author

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?

Copy link
Collaborator

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?

Copy link
Collaborator Author

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

Copy link
Collaborator

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

Copy link
Collaborator Author

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>
@andyleejordan andyleejordan merged commit 28081e5 into PowerShell:main Mar 17, 2025
4 checks passed
@andyleejordan
Copy link
Member

@sdwheeler @bergmeister this seems to have removed some information from #1704 for docs/Rules/UseCorrectCasing.md specifically around keywords and operators. Was that intentional?

@sdwheeler
Copy link
Collaborator

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area - Documentation Backport Backport of docs changes in PowerShell-Docs-Modules repo Area - Documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants