Skip to content

Commit

Permalink
Updating warning messages and expected code analysis errors
Browse files Browse the repository at this point in the history
  • Loading branch information
BenedekFarkas committed Jun 25, 2024
1 parent 6e10a7b commit 77b5527
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 12 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/test-analysis-failure.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ jobs:
PSPlaceOpenBrace: Open brace is not on a new line.
PSUseApprovedVerbs: The cmdlet 'Violate-Analyzers' uses an unapproved verb.
PSUseConsistentIndentation: Indentation not consistent
PSUseCorrectAutomaticVariableNameCasing: Automatic variables should be used with the correct casing
PSUseCorrectParameterNameCasing: Parameter names should contain only alphanumeric characters and start with an uppercase letter
PSUseCorrectVariableNameCasing: Variable names should contain only alphanumeric characters and start with a lowercase letter
PSUseCorrectAutomaticVariableNameCasing: Automatic variables should be used with the casing according to the documentation
PSUseCorrectParameterNameCasing: Parameter names should start with an uppercase letter
PSUseCorrectVariableNameCasing: Variable names should start with a lowercase letter
PSUseParameterNameDeclaredCasing: Parameters should be used with the declared casing
PSUseSingularNouns: The cmdlet 'Violate-Analyzers' uses a plural noun.
Expand All @@ -52,8 +52,8 @@ jobs:
PSPlaceOpenBrace: Open brace is not on a new line.
PSUseApprovedVerbs: The cmdlet 'Violate-Analyzers' uses an unapproved verb.
PSUseConsistentIndentation: Indentation not consistent
PSUseCorrectAutomaticVariableNameCasing: Automatic variables should be used with the correct casing
PSUseCorrectParameterNameCasing: Parameter names should contain only alphanumeric characters and start with an uppercase letter
PSUseCorrectVariableNameCasing: Variable names should contain only alphanumeric characters and start with a lowercase letter
PSUseCorrectAutomaticVariableNameCasing: Automatic variables should be used with the casing according to the documentation
PSUseCorrectParameterNameCasing: Parameter names should start with an uppercase letter
PSUseCorrectVariableNameCasing: Variable names should start with a lowercase letter
PSUseParameterNameDeclaredCasing: Parameters should be used with the declared casing
PSUseSingularNouns: The cmdlet 'Violate-Analyzers' uses a plural noun.
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,9 @@
- PSUseCorrectAutomaticVariableNameCasing: Automatic variables should be used with the casing according to the
documentation:
https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_automatic_variables.
- PSUseCorrectParameterNameCasing: Parameter names should contain only alphanumeric characters and start with an
uppercase letter.
- PSUseCorrectParameterNameCasing: Parameter names should start with an uppercase letter.
- PSUseParameterNameDeclaredCasing: Parameters should be used with the declared casing.
- PSUseCorrectVariableNameCasing: Variable names should contain only alphanumeric characters and start with a
lowercase letter.
- PSUseCorrectVariableNameCasing: Variable names should start with a lowercase letter.
When fixing warnings, work through the rules in the order they are listed above, because violating
PSUseCorrectParameterNameCasing, while referencing that parameter with the correct casing, will also raise a
Expand Down Expand Up @@ -190,8 +188,8 @@ function Measure-VariableNameCasing
$analyzerViolations += [Microsoft.Windows.Powershell.ScriptAnalyzer.Generic.DiagnosticRecord]@{
'Extent' = $variable.Extent
'Message' = @(
"Automatic variables should be used with the correct casing: '$automaticVariable'"
"instead of '$variableName'."
'Automatic variables should be used with the casing according to the documentation:'
"'$automaticVariable' instead of '$variableName'."
) -join ' '
'RuleName' = 'PSUseCorrectAutomaticVariableNameCasing'
'RuleSuppressionID' = 'PSUseCorrectAutomaticVariableNameCasing'
Expand Down

0 comments on commit 77b5527

Please sign in to comment.