Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upEnhancement request: Suppress rules on a per-statement and/or per-block basis #905
Labels
Comments
|
@swngdnz A similar idea was already proposed here. I agree with your idea to be able to suppress it for the next line/statement/scriptblock or even to turn it on and off for a few lines. I think I will create a meta-issue to collect all those ideas at some point an summarise it in one issue. |
|
Closing as duplicate of #849 now |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Per https://github.com/PowerShell/PSScriptAnalyzer#suppressing-rules, rules can only be suppressed with function or class scope. I'm asking that this be extended to a per-statement and/or per-block basis.
Rationale: same as per-line suppressions in the C# compiler. :-) Sometimes a particular construct must be used. Also, PSSA has bugs (see #903 , for which a workaround was discovered, but there are not always workarounds available).
(Get-Module -ListAvailable PSScriptAnalyzer).Version | ForEach-Object { $_.ToString() }
Environment data