| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
Enables suppression for specific variable/parameter. Fix PowerShell#1589
There was a problem hiding this comment.
Awesome, thanks for improving it, change looks good to me, can you please add one test case for it though?
If possible a test case for each line that was changed, that can return a diagnostic record, but I can understand if that is too much for you, therefore consider this optional.
Sorry, something went wrong.
|
Intentionally skipped it because suppression was only tested in a general test and not per rule. Can try to add some later today if you want. |
Sorry, something went wrong.
| $testCases_ReadOnlyAutomaticVariables = $testCases_AutomaticVariables | Where-Object { $_.IsReadonly } | ||
|
|
||
| It "Variable <VariableName> produces warning of Severity <ExpectedSeverity>" -TestCases $testCases_AutomaticVariables { | ||
| param ($VariableName, $ExpectedSeverity) |
There was a problem hiding this comment.
Tip: Param-blocks are no longer needed in Pester v5. Some keep them to make the testcase-contract visible so didn't remove them :)
Sorry, something went wrong.
|
|
||
| Describe "AvoidAssignmentToAutomaticVariables" { | ||
| Context "ReadOnly Variables" { | ||
| BeforeDiscovery { |
There was a problem hiding this comment.
Added per best practice in Pester v5. Only cosmetic and more explicit in this case.
Sorry, something went wrong.
|
In case it didn't show up - ready for review again 🙂 |
Sorry, something went wrong.
There was a problem hiding this comment.
This is great - thank you.
Christoph Bergmeister (@bergmeister)
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
PR Summary
Enables suppression for specific variable/parameter with rule PSAvoidAssignmentToAutomaticVariable.
Fix #1589
PR Checklist