Skip to content

Commit 2360775

Browse files
author
Kapil Borle
committed
minor changes to comments in the UseToExportFieldsInManifest rule.
1 parent 604f3f4 commit 2360775

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

Rules/UseToExportFieldsInManifest.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,20 +85,21 @@ private bool IsValidManifest(Ast ast, string fileName)
8585
}
8686

8787
/// <summary>
88-
/// Checks if the *ToExport fields are explicitly set to lists, @(...)
88+
/// Checks if the *ToExport fields are explicitly set to arrays, eg. @(...), and the array entries do not contain any wildcard.
8989
/// </summary>
9090
/// <param name="key"></param>
9191
/// <param name="hast"></param>
9292
/// <param name="scriptText"></param>
9393
/// <param name="extent"></param>
94-
/// <returns>A boolean value indicating if the the ToExport fields are explicitly set to lists or not.</returns>
94+
/// <returns>A boolean value indicating if the the ToExport fields are explicitly set to arrays or not.</returns>
9595
private bool HasAcceptableExportField(string key, HashtableAst hast, string scriptText, out IScriptExtent extent)
9696
{
9797
extent = null;
9898
foreach (var pair in hast.KeyValuePairs)
9999
{
100100
if (key.Equals(pair.Item1.Extent.Text.Trim(), StringComparison.OrdinalIgnoreCase))
101101
{
102+
// checks if the right hand side of the assignment is an array.
102103
var arrayAst = pair.Item2.Find(x => x is ArrayLiteralAst || x is ArrayExpressionAst, true);
103104
if (arrayAst == null)
104105
{
@@ -107,6 +108,7 @@ private bool HasAcceptableExportField(string key, HashtableAst hast, string scri
107108
}
108109
else
109110
{
111+
//checks if any entry within the array has a wildcard.
110112
var elementWithWildcard = arrayAst.Find(x => x is StringConstantExpressionAst
111113
&& x.Extent.Text.Contains("*"), false);
112114
if (elementWithWildcard != null)

0 commit comments

Comments
 (0)