-
Notifications
You must be signed in to change notification settings - Fork 388
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
PSUseDeclaredVarsMoreThanAssignments is not aware of Pester's scoping #946
Comments
This is due to #938 |
Using |
Checking on Per scriptblock causes a lot of false positives , for example in the begin block below.
|
@jhoneill there is already issue #804 for begin, process, end blocks. |
@bergmeister thanks, I hadn't looked at #804 ; as you say it isn't trivial to figure out but as-is there are too many false positives … but perhaps not enough to make it a "must fix" |
@jhoneill Because of all issues related to |
+1 we're having the same issue |
Would it be possible to "acknowledge" this kind of error? |
Steps to reproduce
Supposing a Pester Test file like below:
Expected behavior
No warning on the $module variable, as it is used in the code below.
Actual behavior
Invoke-ScriptAnalyzer reports the following:
Environment data
The text was updated successfully, but these errors were encountered: