Skip to content

Commit b7ef03d

Browse files
committed
Remove conditional compilation gates using PSV3 and PSV4
1 parent e280479 commit b7ef03d

21 files changed

+7
-400
lines changed

Engine/Commands/InvokeScriptAnalyzerCommand.cs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,6 @@ public object Settings
227227

228228
private bool stopProcessing;
229229

230-
#if !PSV3
231230
/// <summary>
232231
/// Resolve DSC resource dependency
233232
/// </summary>
@@ -238,7 +237,6 @@ public SwitchParameter SaveDscDependency
238237
set { saveDscDependency = value; }
239238
}
240239
private bool saveDscDependency;
241-
#endif // !PSV3
242240

243241
#if DEBUG
244242
/// <summary>
@@ -387,7 +385,6 @@ protected override void ProcessRecord()
387385
ProcessPath();
388386
}
389387

390-
#if !PSV3
391388
// TODO Support dependency resolution for analyzing script definitions
392389
if (saveDscDependency)
393390
{
@@ -407,7 +404,6 @@ protected override void ProcessRecord()
407404
}
408405
return;
409406
}
410-
#endif
411407
ProcessInput();
412408
}
413409

Engine/FindAstPositionVisitor.cs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,7 @@ namespace Microsoft.Windows.PowerShell.ScriptAnalyzer
88
/// <summary>
99
/// Provides an efficient way to find the position in the AST corresponding to a given script position.
1010
/// </summary>
11-
#if !(PSV3 || PSV4)
1211
internal class FindAstPositionVisitor : AstVisitor2
13-
#else
14-
internal class FindAstPositionVisitor : AstVisitor
15-
#endif
1612
{
1713
private IScriptPosition searchPosition;
1814

@@ -300,7 +296,6 @@ public override AstVisitAction VisitWhileStatement(WhileStatementAst whileStatem
300296
return Visit(whileStatementAst);
301297
}
302298

303-
#if !(PSV3 || PSV4)
304299
public override AstVisitAction VisitBaseCtorInvokeMemberExpression(BaseCtorInvokeMemberExpressionAst baseCtorInvokeMemberExpressionAst)
305300
{
306301
return Visit(baseCtorInvokeMemberExpressionAst);
@@ -335,7 +330,6 @@ public override AstVisitAction VisitUsingStatement(UsingStatementAst usingStatem
335330
{
336331
return AstVisitAction.Continue;
337332
}
338-
#endif
339333

340334
#if !(NET462 || PSV7) // net462 includes V3,4,5
341335
public override AstVisitAction VisitPipelineChain(PipelineChainAst pipelineChainAst)

Engine/Generic/IDSCResourceRule.cs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,6 @@ public interface IDSCResourceRule : IRule
1919
/// <returns>The results of the analysis</returns>
2020
IEnumerable<DiagnosticRecord> AnalyzeDSCResource(Ast ast, string fileName);
2121

22-
#if !PSV3
23-
2422
/// <summary>
2523
/// Analyze dsc classes (if any) in the file
2624
/// </summary>
@@ -29,7 +27,5 @@ public interface IDSCResourceRule : IRule
2927
/// <returns></returns>
3028
IEnumerable<DiagnosticRecord> AnalyzeDSCClass(Ast ast, string fileName);
3129

32-
#endif
33-
3430
}
3531
}

Engine/Generic/ModuleDependencyHandler.cs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
// Copyright (c) Microsoft Corporation. All rights reserved.
22
// Licensed under the MIT License.
33

4-
#if !PSV3
54
using System;
65
using System.Collections.Generic;
76
using System.IO;
@@ -519,5 +518,4 @@ public void Dispose()
519518

520519
#endregion Public Methods
521520
}
522-
}
523-
#endif // !PSV3
521+
}

Engine/Generic/RuleSuppression.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -333,12 +333,10 @@ public static List<RuleSuppression> GetSuppressions(IEnumerable<AttributeAst> at
333333
{
334334
targetAsts = scopeAst.FindAll(ast => ast is FunctionDefinitionAst && reg.IsMatch((ast as FunctionDefinitionAst).Name), true);
335335
}
336-
#if !(PSV3 || PSV4)
337336
else if (scope.Equals("class", StringComparison.OrdinalIgnoreCase))
338337
{
339338
targetAsts = scopeAst.FindAll(ast => ast is TypeDefinitionAst && reg.IsMatch((ast as TypeDefinitionAst).Name), true);
340339
}
341-
#endif
342340

343341
if (targetAsts != null)
344342
{

0 commit comments

Comments
 (0)