Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Enable suppression of PSAvoidAssignmentToAutomaticVariable for specific variable or parameter#1896

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
bergmeister merged 2 commits intoPowerShell:masterfromfflaten:autovariable-ruleid
Sep 17, 2023

Conversation

@fflaten
Copy link
Contributor

@fflatenfflaten commentedFeb 27, 2023
edited
Loading

PR Summary

Enables suppression for specific variable/parameter with rule PSAvoidAssignmentToAutomaticVariable.
Fix#1589

PR Checklist

Enables suppression for specific variable/parameter.FixPowerShell#1589
Copy link
Collaborator

@bergmeisterbergmeister left a comment
edited
Loading

Choose a reason for hiding this comment

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

Awesome, thanks for improving it, change looks good to me, can you please add one test case for it though?
If possible a test case for each line that was changed, that can return a diagnostic record, but I can understand if that is too much for you, therefore consider this optional.

@fflaten
Copy link
ContributorAuthor

Intentionally skipped it because suppression was only tested in a general test and not per rule.

Can try to add some later today if you want.

bergmeister and ALiwoto reacted with thumbs up emoji

$testCases_ReadOnlyAutomaticVariables=$testCases_AutomaticVariables|Where-Object {$_.IsReadonly }

It"Variable <VariableName> produces warning of Severity <ExpectedSeverity>"-TestCases$testCases_AutomaticVariables {
param ($VariableName,$ExpectedSeverity)
Copy link
ContributorAuthor

@fflatenfflatenFeb 28, 2023
edited
Loading

Choose a reason for hiding this comment

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

Tip: Param-blocks are no longer needed in Pester v5. Some keep them to make the testcase-contract visible so didn't remove them :)


Describe"AvoidAssignmentToAutomaticVariables" {
Context"ReadOnly Variables" {
BeforeDiscovery {
Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

Added per best practice in Pester v5. Only cosmetic and more explicit in this case.

@fflaten
Copy link
ContributorAuthor

fflaten commentedMar 16, 2023
edited
Loading

In case it didn't show up - ready for review again 🙂

Copy link
Contributor

@JamesWTruherJamesWTruher left a comment

Choose a reason for hiding this comment

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

This is great - thank you.
@bergmeister

fflaten reacted with hooray emoji
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@bergmeisterbergmeisterbergmeister approved these changes

+1 more reviewer

@JamesWTruherJamesWTruherJamesWTruher approved these changes

Reviewers whose approvals may not affect merge requirements

Assignees

No one assigned

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Cannot Suppress Messages About a Specific Automatic Variable

3 participants

@fflaten@bergmeister@JamesWTruher

[8]ページ先頭

©2009-2025 Movatter.jp