Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow for suppression of custom rules #1145

Merged

Conversation

bergmeister
Copy link
Collaborator

@bergmeister bergmeister commented Feb 21, 2019

PR Summary

  • Fixes Add support for suppressing custom rules #1140 by calling GetFullName in the rule suppression lookup code as custom rules have a longer rule name. This might be also interesting for you guys: @LaurentDardenne @thomasrayner
  • Fix rule name lookup mismatch for custom rules to allow for suppression and unify code.
  • Fix engine code to be able to cope with custom rules that return records where the Extent is not set (i.e. null), before PSSA threw NullReferenceExceptions.

PR Checklist

@bergmeister bergmeister added this to the 1.18 milestone Feb 21, 2019
bergmeister and others added 4 commits February 21, 2019 21:49
…oid breaking existing functionality, therefore also revert the last change in test file
…uppressing custom rules when there is no Extent supplied
@bergmeister bergmeister marked this pull request as ready for review February 24, 2019 15:37
@bergmeister bergmeister added the (Re-)Review Needed Feedback has been addressed during PR stage or is required in the first place. label Feb 24, 2019
@bergmeister bergmeister merged commit b2ae082 into PowerShell:development Mar 5, 2019
bergmeister added a commit to bergmeister/PSScriptAnalyzer that referenced this pull request Mar 22, 2019
* Fix rule name lookup mismatch for custom rules to allow for suppresion and unify code

* Remove note that custom rules suppression are not supported

* fix CustomizedRule.tests.ps1

* do not change GetName method and add GetFullName method instead to avoid breaking existing functionality, therefore also revert the last change in test file

* Add test and fix dummy test rule to return script extent. TODO: Fix suppressing custom rules when there is no Extent supplied

* Make test custom rule return null extent again by fixing the Engine to be able to cope with it
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area - Engine (Re-)Review Needed Feedback has been addressed during PR stage or is required in the first place.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add support for suppressing custom rules
2 participants