Skip to content

Exclude automatic variable FormatEnumerationLimit from analysis by PSAvoidGlobalVars and PSUseDeclaredVarsMoreThanAssignments #1836

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

Merged
merged 1 commit into from
Sep 22, 2022

Conversation

bergmeister
Copy link
Collaborator

@bergmeister bergmeister commented Aug 31, 2022

PR Summary

Fixes #1756 by adding 1756 to the list of automatic variables that are excluded by PSAvoidGlobalVars and PSUseDeclaredVarsMoreThanAssignments. I don't think this warrants adding a test but I did a quick manual test though that Invoke-ScriptAnalyzer -ScriptDefinition '$FormatEnumerationLimit = 2' and Invoke-ScriptAnalyzer -ScriptDefinition '$global:FormatEnumerationLimit = 2' do not return a warning. Not urgently needed for 1.21.0 so could wait.

PR Checklist

@bergmeister bergmeister changed the title Update SpecialVars.cs Exclude automatic variable FormatEnumerationLimit from analysis by PSAvoidGlobalVars and PSUseDeclaredVarsMoreThanAssignments Aug 31, 2022
@JamesWTruher JamesWTruher merged commit da2c918 into master Sep 22, 2022
@andyleejordan andyleejordan deleted the Add-FormatEnumerationLimit-ToSpecialVars branch September 11, 2024 22:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

$FormatEnumerationLimit triggers PSAvoidGlobalVars warning
2 participants