Skip to content
Merged
Changes from all commits
Commits
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
9 changes: 6 additions & 3 deletions Rules/CompatibilityRules/UseCompatibleSyntax.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,15 @@ public class UseCompatibleSyntax : ConfigurableRule

private static readonly Version s_v6 = new Version(6,0);

private static readonly Version s_v7 = new Version(7,0);

private static readonly IReadOnlyList<Version> s_targetableVersions = new []
{
s_v3,
s_v4,
s_v5,
s_v6
s_v6,
s_v7,
};

/// <summary>
Expand Down Expand Up @@ -123,7 +126,7 @@ private static HashSet<Version> GetTargetedVersions(string[] versionSettings)
{
if (versionSettings == null || versionSettings.Length <= 0)
{
return new HashSet<Version>(){ s_v5, s_v6 };
return new HashSet<Version>(){ s_v5, s_v6, s_v7 };
}

var targetVersions = new HashSet<Version>();
Expand Down Expand Up @@ -278,7 +281,7 @@ public override AstVisitAction VisitFunctionDefinition(FunctionDefinitionAst fun
{
// Look for PowerShell workflows in the script

if (!_targetVersions.Contains(s_v6))
if (!(_targetVersions.Contains(s_v6) || _targetVersions.Contains(s_v7)))
{
return AstVisitAction.Continue;
}
Expand Down