-
Notifications
You must be signed in to change notification settings - Fork 358
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move RulesVerifier to the RulesEngine namespace (#479)
- Loading branch information
Showing
9 changed files
with
94 additions
and
69 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using Microsoft.CST.OAT; | ||
|
||
namespace Microsoft.ApplicationInspector.RulesEngine; | ||
|
||
public class RuleStatus | ||
{ | ||
public string? RulesId { get; set; } | ||
public string? RulesName { get; set; } | ||
public bool Verified => !Errors.Any() && !OatIssues.Any(); | ||
public IEnumerable<string> Errors { get; set; } = Enumerable.Empty<string>(); | ||
public IEnumerable<Violation> OatIssues { get; set; } = Enumerable.Empty<Violation>(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
using Microsoft.CST.OAT; | ||
using Microsoft.Extensions.Logging; | ||
|
||
namespace Microsoft.ApplicationInspector.RulesEngine; | ||
|
||
public class RulesVerifierOptions | ||
{ | ||
/// <summary> | ||
/// If desired you may provide the analyzer to use. An analyzer with AI defaults will be created to use for validation. | ||
/// </summary> | ||
public Analyzer? Analyzer { get; set; } | ||
/// <summary> | ||
/// To receive log messages, provide a LoggerFactory with your preferred configuration. | ||
/// </summary> | ||
public ILoggerFactory? LoggerFactory { get; set; } | ||
/// <summary> | ||
/// If true, the verifier will stop on the first issue and will not continue reporting issues. | ||
/// </summary> | ||
public bool FailFast { get; set; } | ||
public Languages LanguageSpecs { get; set; } = new Languages(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
|
||
namespace Microsoft.ApplicationInspector.RulesEngine; | ||
|
||
public class RulesVerifierResult | ||
{ | ||
public RulesVerifierResult(List<RuleStatus> ruleStatuses, AbstractRuleSet compiledRuleSets) | ||
{ | ||
RuleStatuses = ruleStatuses; | ||
CompiledRuleSet = compiledRuleSets; | ||
} | ||
public List<RuleStatus> RuleStatuses { get; } | ||
public AbstractRuleSet CompiledRuleSet { get; } | ||
public bool Verified => RuleStatuses.All(x => x.Verified); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters