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 typo in rule name output #560

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions Engine/about_PSScriptAnalyzer.help.txt
Expand Up @@ -134,14 +134,14 @@ RUNNING SCRIPT ANALYZER ON AN EXISTING SCRIPT, MODULE OR DSC RESOURCE
Count Name
----- ----
23 PSAvoidUsingInvokeExpression
8 PSUseDeclaredVarsMoreThanAssigments
8 PSUseDeclaredVarsMoreThanAssignments
8 PSProvideDefaultParameterValue
6 PSAvoidUninitializedVariable
3 PSPossibleIncorrectComparisonWithNull
1 PSAvoidUsingComputerNameHardcoded

You may decide to exclude the PSAvoidUsingInvokeExpression rule for the moment
and focus on the rest, especially the PSUseDeclaredVarsMoreThanAssigments,
and focus on the rest, especially the PSUseDeclaredVarsMoreThanAssignments,
PSAvoidUninitializedVariable and PSPossibleIncorrectComparisonWithNull rules.

As you fix rules, go back and enable more rules as you have time to address
Expand Down
2 changes: 1 addition & 1 deletion Rules/Strings.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Rules/Strings.resx
Expand Up @@ -445,7 +445,7 @@
<value>UseApprovedVerbs</value>
</data>
<data name="UseDeclaredVarsMoreThanAssignmentsName" xml:space="preserve">
<value>UseDeclaredVarsMoreThanAssigments</value>
<value>UseDeclaredVarsMoreThanAssignments</value>
</data>
<data name="UsePSCredentialTypeName" xml:space="preserve">
<value>UsePSCredentialType</value>
Expand Down Expand Up @@ -822,4 +822,4 @@
<data name="UseToExportFieldsInManifestCorrectionDescription" xml:space="preserve">
<value>Replace {0} with {1}</value>
</data>
</root>
</root>
4 changes: 2 additions & 2 deletions Rules/UseDeclaredVarsMoreThanAssignments.cs
Expand Up @@ -20,10 +20,10 @@
namespace Microsoft.Windows.PowerShell.ScriptAnalyzer.BuiltinRules
{
/// <summary>
/// UseDeclaredVarsMoreThanAssigments: Analyzes the ast to check that variables are used in more than just their assignment.
/// UseDeclaredVarsMoreThanAssignments: Analyzes the ast to check that variables are used in more than just their assignment.
/// </summary>
[Export(typeof(IScriptRule))]
public class UseDeclaredVarsMoreThanAssigments : IScriptRule
public class UseDeclaredVarsMoreThanAssignments : IScriptRule
{
/// <summary>
/// AnalyzeScript: Analyzes the ast to check that variables are used in more than just there assignment.
Expand Down
2 changes: 1 addition & 1 deletion Tests/Rules/UseDeclaredVarsMoreThanAssignments.tests.ps1
@@ -1,6 +1,6 @@
Import-Module PSScriptAnalyzer
$violationMessage = "The variable 'declaredVar2' is assigned but never used."
$violationName = "PSUseDeclaredVarsMoreThanAssigments"
$violationName = "PSUseDeclaredVarsMoreThanAssignments"
$directory = Split-Path -Parent $MyInvocation.MyCommand.Path
$violations = Invoke-ScriptAnalyzer $directory\UseDeclaredVarsMoreThanAssignments.ps1 | Where-Object {$_.RuleName -eq $violationName}
$noViolations = Invoke-ScriptAnalyzer $directory\UseDeclaredVarsMoreThanAssignmentsNoViolations.ps1 | Where-Object {$_.RuleName -eq $violationName}
Expand Down