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 upSuppress External Rules #585
Conversation
This comment has been minimized.
This comment has been minimized.
kapilmb
commented on fec8d79
Jul 21, 2016
|
Awesome changes! Some comments though - I think you can move your additions to the |
…, rather than 1-by-1 to continue to take advantage of the runspacepool stuff. New SupressRule() function that takes a single DiagnosticRecord and list of suppressions - bounces the RuleName of the record against that list.
This comment has been minimized.
This comment has been minimized.
|
@kapilmb - indeed, no rejiggering of GetExternalRecord needed, just a new SuppressRule variant that takes a single rule and list of suppressions. |
This comment has been minimized.
This comment has been minimized.
kapilmb
replied
Jul 22, 2016
|
@charlieschmidt If you would like to have these changes propagated upstream, please send a pull request. But, before you send a PR, please add a few test cases to validate the functionality. Thanks! |
This comment has been minimized.
This comment has been minimized.
|
Yeah, looking at the test stuff now, looks like yall use pester, which is new to me so far, but no time like the present (especially since the module repository I manage at work is.... not small) |
This comment has been minimized.
This comment has been minimized.
kapilmb
replied
Jul 22, 2016
|
No worries. Maybe I can write a few test cases to validate the functionality. I just created a new branch (https://github.com/PowerShell/PSScriptAnalyzer/tree/ExternalRuleSuppression). So, if you can send a PR on the branch, I can add the test cases to the branch before merging into development |
This comment has been minimized.
This comment has been minimized.
kapilmb
replied
Jul 22, 2016
|
Or if you can suggest a better workflow to have it merged while I add the test cases please let me know. |
msftclas
commented
Jul 22, 2016
|
Hi @charlieschmidt, I'm your friendly neighborhood Microsoft Pull Request Bot (You can call me MSBOT). Thanks for your contribution! TTYL, MSBOT; |
msftclas
commented
Jul 22, 2016
|
@charlieschmidt, Thanks for signing the contribution license agreement so quickly! Actual humans will now validate the agreement and then evaluate the PR. |
|
Pull request created. Pester was new to me, to to test I just created a sub C# app that used the scriptanalyzer app, along with my psm1 custom rules and a dummy ps1 with the various cases. But I'll take a stab at some pester stuff too, gotta learn it here anyway and have put it off long enough |
kapilmb
commented
Jul 22, 2016
|
@charlieschmidt Thanks for the pull request. I'll add the test cases. |
|
Hey unrelatedly, I've got a powershell rule that does comment help validation against parameters - so that if you're missing .PARAMETER for one of your params (static and dynamic) it throws the alert. ANy interested in a C# port of it to include in the builtins? |
kapilmb
commented
Jul 22, 2016
|
Why don't you send a PR against the development branch for the new rule? We can go from there. |
kapilmb
commented
Jul 22, 2016
|
I think we need a way to utilize PowerShell based built-in rules. But, right now we only have C# based built-in rules. So, yes - will be very interested in the C# port. Thanks! |
|
Yeah, powershell built ins - at least a couple examples - would go a long way. I had to read the C# and figure out how to make it powershell for my custom rules. Could probably be done "easily" in another module that gets pulled with it, or a submodule that contains them and then hardcode that module into the scriptengine. I'll port to C# in a branch in my repo and include the ps version as well |
charlieschmidt commentedJul 22, 2016
•
edited by raghushantha
External/custom rules can now be suppressed with the same DiagnosticRecord decoration on functions.
This change is