private (IBicepAnalyzerRule[] rules, JObject configSchema) GetRulesAndSchema() { var linter = new LinterAnalyzer(BicepTestConstants.BuiltInConfiguration); var ruleSet = linter.GetRuleSet(); ruleSet.Should().NotBeEmpty(); var configStream = typeof(BicepConfigSchemaTests).Assembly.GetManifestResourceStream( $"{typeof(BicepConfigSchemaTests).Assembly.GetName().Name}.bicepconfig.schema.json"); Assert.IsNotNull(configStream); var configContents = new StreamReader(configStream).ReadToEnd(); Assert.IsNotNull(configContents); var configSchema = JObject.Parse(configContents); return(ruleSet.ToArray(), configSchema); }
public void BuiltInRulesExist(string ruleCode) { var linter = new LinterAnalyzer(); linter.GetRuleSet().Should().Contain(r => r.Code == ruleCode); }
public void HasBuiltInRules() { var linter = new LinterAnalyzer(); linter.GetRuleSet().Should().NotBeEmpty(); }
private CompilationContext CreateContext(SourceFileGrouping syntaxTreeGrouping, ImmutableDictionary <ISourceFile, ISemanticModel> modelLookup, RootConfiguration configuration, LinterAnalyzer linterAnalyzer) { var compilation = new Compilation(this.features, namespaceProvider, syntaxTreeGrouping, configuration, linterAnalyzer, modelLookup); return(new CompilationContext(compilation)); }
public CompilationContext Update(IReadOnlyWorkspace workspace, CompilationContext current, ImmutableDictionary <ISourceFile, ISemanticModel> modelLookup, RootConfiguration configuration, LinterAnalyzer linterAnalyzer) { var syntaxTreeGrouping = SourceFileGroupingBuilder.Rebuild(moduleDispatcher, workspace, current.Compilation.SourceFileGrouping, configuration); return(this.CreateContext(syntaxTreeGrouping, modelLookup, configuration, linterAnalyzer)); }
public CompilationContext Create(IReadOnlyWorkspace workspace, DocumentUri documentUri, ImmutableDictionary <ISourceFile, ISemanticModel> modelLookup, RootConfiguration configuration, LinterAnalyzer linterAnalyzer) { var syntaxTreeGrouping = SourceFileGroupingBuilder.Build(fileResolver, moduleDispatcher, workspace, documentUri.ToUri(), configuration); return(this.CreateContext(syntaxTreeGrouping, modelLookup, configuration, linterAnalyzer)); }