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

OSOE-580: Custom analyzer rule for parameter and variable name styling #363

Merged
merged 18 commits into from
Jun 30, 2024

Conversation

BenedekFarkas
Copy link
Member

@BenedekFarkas BenedekFarkas commented Jun 12, 2024

@@ -8,4 +8,4 @@ $rootDirectory = (Test-Path -Path $testDirectory) ? $testDirectory : $Directory
Get-ChildItem $rootDirectory -Recurse |
Where-Object { $PSItem.Name -eq 'FailureDumps' } |
ForEach-Object { $PSItem.GetDirectories() } |
ForEach-Object { Move-Item $PSItem.FullName "$Directory/FailureDumps/${_.Name}" }
ForEach-Object { Move-Item $PSItem.FullName "$Directory/FailureDumps/$($PSItem.Name)" }
Copy link
Member Author

Choose a reason for hiding this comment

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

FYI this is a functional change, not just cosmetic. Variable names enclosed in braces are used to be able to use special characters in the variable name, so it won't behave the same as $_.Name (or $PSItem.Name). I also removed usages of braced variables in other files.

Idea: Add an analyzer that detects that braced variables are used unnecessarily, which is basically when you don't have a special character enclosed in the braces.

@sarahelsaig sarahelsaig added this pull request to the merge queue Jun 30, 2024
Merged via the queue into dev with commit f43512d Jun 30, 2024
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants