Implement -IncludeSuppressions parameter#1701
Conversation
This comment has been minimized.
This comment has been minimized.
|
Ok, I've spent ages trying to debug this but it doesn't make any sense. The new parameter sets aren't present, but the command is loaded from the asset location, and this only happens in WinPS 5.1... |
Sorry, something went wrong.
|
I finally worked this out. We have a bizarre test that overrides |
Sorry, something went wrong.
This comment has been minimized.
This comment has been minimized.
bergmeister
left a comment
There was a problem hiding this comment.
Overall looks good but not sure whether doubling the parameter sets is the right way. This can make the experience more confusing for users and makes maintenance more complicated as well. How about an Enum parameter instead that has a default?
Some good improvements to tests that made some assumptions :-)
Sorry, something went wrong.
So I would prefer an enum parameter, but that would be a breaking change; invocations that previously use In order to keep |
Sorry, something went wrong.
|
Hmm, didn't realize Having said that, this topic is opinionated and I am sure the other side will argue for param sets with its early validation before actually running the command. Therefore I suggest we let a 3rd person like @JamesWTruher decide on this matter. I am happy with the rest of the PR. |
Sorry, something went wrong.
|
@rjmholt @bergmeister i'm generally in favor of adding parameter sets where they make sense and don't over complicate things. In this case we're going from 2 to only 4 so i don't believe it's a higher cognitive load. The benefit with parameter sets is that we can determine behavior via inspection rather than runtime, so tools like vscode provide a better experience. |
Sorry, something went wrong.
c970e73 to
02ccd84
Compare
August 3, 2021 22:15
|
@bergmeister @JamesWTruher need an approval to merge 🙂 |
Sorry, something went wrong.

PR Summary
Implements the
-IncludeSuppressionsparameter, allowing a singleInvoke-ScriptAnalyzerinvocation to emit all diagnostics including suppressed ones, decorating the suppressed ones accordingly.Also adds an
IsSuppressedproperty on diagnostics./cc @t-lipingma
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.