X Tutup
The Wayback Machine - https://web.archive.org/web/20200918094718/https://github.com/PowerShell/PSScriptAnalyzer/pull/1145
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 commented Feb 21, 2019

PR Summary

  • Fixes #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 Feb 21, 2019
…oid breaking existing functionality, therefore also revert the last change in test file
…uppressing custom rules when there is no Extent supplied
…o be able to cope with it
@bergmeister bergmeister marked this pull request as ready for review Feb 24, 2019
@rjmholt
rjmholt approved these changes Mar 5, 2019
@bergmeister bergmeister merged commit b2ae082 into PowerShell:development Mar 5, 2019
2 checks passed
2 checks passed
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
license/cla All CLA requirements met.
Details
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
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

2 participants
You can’t perform that action at this time.
X Tutup