ReviewUnusedParameter: Do not trigger when MyInvocation.BoundParameters or PSCmdlet.MyInvocation.BoundParameters is used#1520
Conversation
…eters encountered
Enhance ReviewUnusedParameter to bail out if $MyInvocation.BoundParameters encountered
There was a problem hiding this comment.
Thanks. Implementation looks good to me, just a minor suggestion.
Every new feature or fix needs to be accompanied by one or more test cases though. If you look qt the existing tests, it should be very easy to add 2 tests for the cases that you added:
PSScriptAnalyzer/Tests/Rules/ReviewUnusedParameter.tests.ps1
Lines 53 to 57 in 67805a1
Also, when you use a closing keyword in the PR description it will close the referenced issue
https://help.github.com/en/github/managing-your-work-on-github/linking-a-pull-request-to-an-issue#linking-a-pull-request-to-an-issue-using-a-keyword
rjmholt
left a comment
There was a problem hiding this comment.
LGTM, with two small comments
- Add pester tests
|
Thanks both for your feedback. @bergmeister did not approve the PR, so requested review again.
Writing pester tests for testing PSSA rule behavior is the most easiest job I have come across :) |
bergmeister
left a comment
There was a problem hiding this comment.
Thanks, looks good 😊
PR Summary
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.