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

Fix (and test) regression with PSScriptAnalyzer default rules #1873

Merged
merged 1 commit into from
Aug 5, 2022

Conversation

andyleejordan
Copy link
Member

When we swapped a ternary for a null-coalescing operator we ran into a problem because the two constructor overloads took string[] and object, and we were now calling the constructor first, which meant the object version was always being called. This erroneously sent the rule list to the settings object parameter.

Fixes PowerShell/vscode-powershell#4112.

@andyleejordan andyleejordan requested a review from a team August 5, 2022 19:28
When we swapped a ternary for a null-coalescing operator we ran into a
problem because the two constructor overloads took `string[]` and
`object`, and we were now calling the constructor first, which meant the
`object` version was always being called. This erroneously sent the rule
list to the settings object parameter.
@andyleejordan andyleejordan force-pushed the andschwa/pssa-rules-fix branch from 14039d7 to 1e009df Compare August 5, 2022 19:43
@andyleejordan andyleejordan enabled auto-merge (squash) August 5, 2022 19:52
Copy link
Collaborator

@SeeminglyScience SeeminglyScience left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@andyleejordan andyleejordan merged commit 9666ced into main Aug 5, 2022
@andyleejordan andyleejordan deleted the andschwa/pssa-rules-fix branch August 5, 2022 19:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

PSScriptAnalyzer default rules are not applying
2 participants