-
Notifications
You must be signed in to change notification settings - Fork 9
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
Conversation
@@ -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)" } |
There was a problem hiding this comment.
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.
OSOE-580