Skip to content

Commit af3e4b1

Browse files
author
Kapil Borle
committed
Merge pull request #322 from kapilmb/FixAvoidInvokingEmptyMembers
Fixes the documentation of AvoidInvokingEmptyMembers rule.
2 parents 0f48641 + 4ccbbee commit af3e4b1

File tree

5 files changed

+8
-7
lines changed

5 files changed

+8
-7
lines changed

RuleDocumentation/AvoidInvokingEmptyMembers.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
##Description
66

7-
Invoking non-constant members would cause potential bugs. Please double check the syntax to make sure members invoked are non-constant.
7+
Invoking non-constant members would cause potential bugs. Please double check the syntax to make sure that invoked members are constants.
88

99

1010
##How to Fix

Rules/AvoidInvokingEmptyMembers.cs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,15 @@
2020

2121
namespace Microsoft.Windows.PowerShell.ScriptAnalyzer.BuiltinRules
2222
{
23+
// Rule name is inconsistent.
2324
/// <summary>
24-
/// AvoidAlias: Check if cmdlet alias is used.
25-
/// </summary>
25+
/// AvoidInvokingEmptyMembers: Analyzes the script to check if any non-constant members have been invoked.
26+
/// </summary>
2627
[Export(typeof(IScriptRule))]
2728
public class AvoidInvokingEmptyMembers : IScriptRule
2829
{
2930
/// <summary>
30-
/// AnalyzeScript: Analyze the script to check if any empty members has been invoked.
31+
/// AnalyzeScript: Analyzes the script to check if any non-constant members have been invoked.
3132
/// </summary>
3233
public IEnumerable<DiagnosticRecord> AnalyzeScript(Ast ast, string fileName)
3334
{

Rules/Strings.Designer.cs

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Rules/Strings.resx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -526,7 +526,7 @@
526526
<value>Invoking non-constant members would cause potential bugs. Please double check the syntax to make sure members invoked are non-constant.</value>
527527
</data>
528528
<data name="AvoidInvokingEmptyMembersError" xml:space="preserve">
529-
<value>'{0}' has non-constant members. Invoking empty members may cause bugs in the script.</value>
529+
<value>'{0}' has non-constant members. Invoking non-constant members may cause bugs in the script.</value>
530530
</data>
531531
<data name="AvoidInvokingEmptyMembersName" xml:space="preserve">
532532
<value>AvoidInvokingEmptyMembers</value>

Tests/Rules/AvoidInvokingEmptyMembers.tests.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Import-Module PSScriptAnalyzer
22

3-
$violationMessage = "() has non-constant members. Invoking empty members may cause bugs in the script."
3+
$violationMessage = "() has non-constant members. Invoking non-constant members may cause bugs in the script."
44
$violationName = "PSAvoidInvokingEmptyMembers"
55
$directory = Split-Path -Parent $MyInvocation.MyCommand.Path
66
$violations = Invoke-ScriptAnalyzer $directory\AvoidInvokingEmptyMembers.ps1 | Where-Object {$_.RuleName -eq $violationName}

0 commit comments

Comments
 (0)