Skip to content

Take Development to Master for next release #484

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

Merged
merged 41 commits into from
Mar 29, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
a406d8f
Fixes to UseToExportFieldsInManifest rule.
Feb 18, 2016
118d8ee
Fixes some bugs in UseToExportFieldsInManifest rule.
Feb 18, 2016
f45004e
Minor changes to FixUseToExportInManifestRule to improve performance.
Feb 19, 2016
0f82359
Minor changes to methods that implement finding wildcard or null in a…
Feb 22, 2016
e74ea46
Merge pull request #453 from PowerShell/FixUseToExportFieldsInManifest
Feb 22, 2016
84d6896
Fixes to AvoidNullOrEmptyHelpMessageAttribute.
Feb 23, 2016
f719a3b
Merge pull request #454 from PowerShell/FixAvoidNullOrEmptyHelpMessag…
Feb 24, 2016
87be819
Update README.md
raghushantha Feb 29, 2016
fc4eff4
Modifies the error message of AvoidUsernameAndPasswordParams rule.
Mar 3, 2016
3e1bc0d
Modifies the error message of UsePSCredentialType as the rule is not …
Mar 4, 2016
e2b77f2
Fixes a bug that prevented rule modules with version in their path fr…
Mar 11, 2016
a67642c
Update the error messages of UsePSCredentialType and AvoidUsernameAnd…
Mar 11, 2016
8bd5a97
Merge pull request #462 from PowerShell/FixCustomRulePath
Mar 11, 2016
34f9aa4
Fix loading custom rules that do not have comment help
Mar 12, 2016
68ae3ff
Changes the appveyor default image to Visual Studio 2015
Mar 14, 2016
f090fa7
Change appveyor settings path
Mar 14, 2016
eecab58
Change appveyor os image to WMF 5
Mar 14, 2016
735e914
Merge pull request #468 from PowerShell/ChangeAppVeyorSettings
Mar 14, 2016
7d766f1
Change appveyor os image to WMF 5
Mar 14, 2016
5de9a47
Merge pull request #464 from PowerShell/FixCustomRuleWithoutHelp
Mar 14, 2016
98323d0
Change the example in UsePSCredentialType error message
Mar 15, 2016
d43a478
Merge pull request #456 from PowerShell/FixCredentialUsageErrorMessage
Mar 16, 2016
9ce81fe
Remove severity inconsistency for AvoidUsingConvertToSecureStringWith…
Mar 16, 2016
159a394
Set the severity level of AvoidUsingConvertToSecureStringWithPlainText
Mar 17, 2016
e0a5cb6
Fix the severity level of UseIdenticalParametersDSC rule.
Mar 21, 2016
8c15ac9
Add an abstract method to retrieve DiagnosticSeverity in AvoidCmdletG…
Mar 21, 2016
b66e1cc
Fix typos in source comments
Mar 21, 2016
8334c5e
Move AvoidUsingFilePaths and AvoidUnloadableModule to deprecated rule…
Mar 21, 2016
6b51b94
Merge pull request #470 from PowerShell/FixSeverityInconsistency
Mar 21, 2016
3e24e3d
Merge pull request #1 from PowerShell/development
kilasuit Mar 22, 2016
6d66d75
Dirty fix for the issue raised in #473
kilasuit Mar 22, 2016
37201c8
Correct Fix for issue #473
kilasuit Mar 24, 2016
14d8a2e
Added Tests to compliment fix for issue #473
kilasuit Mar 24, 2016
16b407f
Updates the Initialize method to process the profile parameter.
rkeithhill Mar 27, 2016
3571167
Merge pull request #478 from rkeithhill/rkeithhill/initialize-process…
raghushantha Mar 28, 2016
c597849
Fix severity filtering while invoking script analyzer
Mar 29, 2016
27d9d2b
Fix for hang issue
raghushantha Mar 29, 2016
890cd12
Merge pull request #481 from PowerShell/HangIssueFixBranch
raghushantha Mar 29, 2016
57f4efc
Run rules as tasks only if they are allowed
Mar 29, 2016
a8ea91b
Merge pull request #474 from kilasuit/development
Mar 29, 2016
31de911
Merge pull request #480 from PowerShell/FixInvokeScriptAnalyzerSeveri…
Mar 29, 2016
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
File renamed without changes.
8 changes: 7 additions & 1 deletion Engine/Generic/AvoidCmdletGeneric.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public IEnumerable<DiagnosticRecord> AnalyzeScript(Ast ast, string fileName)

if (cmdletNameAndAliases.Contains(cmdAst.GetCommandName(), StringComparer.OrdinalIgnoreCase))
{
yield return new DiagnosticRecord(GetError(fileName), cmdAst.Extent, GetName(), DiagnosticSeverity.Warning, fileName);
yield return new DiagnosticRecord(GetError(fileName), cmdAst.Extent, GetName(), GetDiagnosticSeverity(), fileName);
}
}
}
Expand Down Expand Up @@ -97,5 +97,11 @@ public IEnumerable<DiagnosticRecord> AnalyzeScript(Ast ast, string fileName)
/// </summary>
/// <returns></returns>
public abstract RuleSeverity GetSeverity();

/// <summary>
/// DiagnosticSeverity: Returns the severity of the rule of type DiagnosticSeverity
/// </summary>
/// <returns></returns>
public abstract DiagnosticSeverity GetDiagnosticSeverity();
}
}
12 changes: 11 additions & 1 deletion Engine/Generic/AvoidParameterGeneric.cs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public IEnumerable<DiagnosticRecord> AnalyzeScript(Ast ast, string fileName)
{
if (ParameterCondition(cmdAst, ceAst))
{
yield return new DiagnosticRecord(GetError(fileName, cmdAst), cmdAst.Extent, GetName(), DiagnosticSeverity.Warning, fileName, cmdAst.GetCommandName());
yield return new DiagnosticRecord(GetError(fileName, cmdAst), cmdAst.Extent, GetName(), GetDiagnosticSeverity(), fileName, cmdAst.GetCommandName());
}
}
}
Expand Down Expand Up @@ -102,6 +102,16 @@ public IEnumerable<DiagnosticRecord> AnalyzeScript(Ast ast, string fileName)
/// <returns>The source type of the rule.</returns>
public abstract SourceType GetSourceType();

/// <summary>
/// RuleSeverity: Returns the severity of the rule.
/// </summary>
/// <returns></returns>
public abstract RuleSeverity GetSeverity();

/// <summary>
/// DiagnosticSeverity: Returns the severity of the rule of type DiagnosticSeverity
/// </summary>
/// <returns></returns>
public abstract DiagnosticSeverity GetDiagnosticSeverity();
}
}
15 changes: 10 additions & 5 deletions Engine/Helper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ public class Helper

private CommandInvocationIntrinsics invokeCommand;
private IOutputWriter outputWriter;
private Object getCommandLock = new object();

#endregion

Expand Down Expand Up @@ -100,9 +101,9 @@ internal set
/// </summary>
private Dictionary<Ast, VariableAnalysis> VariableAnalysisDictionary;

private string[] functionScopes = new string[] { "global:", "local:", "script:", "private:" };
private string[] functionScopes = new string[] { "global:", "local:", "script:", "private:"};

private string[] variableScopes = new string[] { "global:", "local:", "script:", "private:", "variable:", ":" };
private string[] variableScopes = new string[] { "global:", "local:", "script:", "private:", "variable:", ":"};

#endregion

Expand Down Expand Up @@ -419,7 +420,8 @@ private string NameWithoutScope(string name, string[] scopes)
foreach (string scope in scopes)
{
// trim the scope part
if (name.IndexOf(scope) == 0)
if (name.IndexOf(scope, StringComparison.OrdinalIgnoreCase) == 0)

{
return name.Substring(scope.Length);
}
Expand Down Expand Up @@ -567,7 +569,10 @@ public bool PositionalParameterUsed(CommandAst cmdAst, bool moreThanThreePositio
/// <returns></returns>
public CommandInfo GetCommandInfo(string name, CommandTypes commandType = CommandTypes.Alias | CommandTypes.Cmdlet | CommandTypes.Configuration | CommandTypes.ExternalScript | CommandTypes.Filter | CommandTypes.Function | CommandTypes.Script | CommandTypes.Workflow)
{
return this.invokeCommand.GetCommand(name, commandType);
lock (getCommandLock)
{
return this.invokeCommand.GetCommand(name, commandType);
}
}

/// <summary>
Expand Down Expand Up @@ -3022,4 +3027,4 @@ public object VisitUsingExpression(UsingExpressionAst usingExpressionAst)
return null;
}
}
}
}
Loading