Skip to content

Commit 0758449

Browse files
authored
Merge pull request #2978 from vyrp/stylecoptester/stylecop_json
Making StyleCopTester take stylecop.json into account.
2 parents f132c76 + 1ad808c commit 0758449

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

StyleCop.Analyzers/StyleCopTester/Program.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,7 @@ private static async Task<DocumentAnalyzerPerformance> TestDocumentPerformanceAs
269269
var processedProject = project.WithCompilationOptions(modifiedCompilationOptions);
270270

271271
Compilation compilation = await processedProject.GetCompilationAsync(cancellationToken).ConfigureAwait(false);
272-
CompilationWithAnalyzers compilationWithAnalyzers = compilation.WithAnalyzers(analyzers, new CompilationWithAnalyzersOptions(new AnalyzerOptions(ImmutableArray.Create<AdditionalText>()), null, true, false));
272+
CompilationWithAnalyzers compilationWithAnalyzers = compilation.WithAnalyzers(analyzers, new CompilationWithAnalyzersOptions(processedProject.AnalyzerOptions, null, true, false));
273273

274274
SyntaxTree tree = await project.GetDocument(documentId).GetSyntaxTreeAsync(cancellationToken).ConfigureAwait(false);
275275
await compilationWithAnalyzers.GetAnalyzerSyntaxDiagnosticsAsync(tree, cancellationToken).ConfigureAwait(false);
@@ -585,7 +585,7 @@ private static async Task<ImmutableArray<Diagnostic>> GetProjectAnalyzerDiagnost
585585
var processedProject = project.WithCompilationOptions(modifiedCompilationOptions);
586586

587587
Compilation compilation = await processedProject.GetCompilationAsync(cancellationToken).ConfigureAwait(false);
588-
CompilationWithAnalyzers compilationWithAnalyzers = compilation.WithAnalyzers(analyzers, new CompilationWithAnalyzersOptions(new AnalyzerOptions(ImmutableArray.Create<AdditionalText>()), null, true, false));
588+
CompilationWithAnalyzers compilationWithAnalyzers = compilation.WithAnalyzers(analyzers, new CompilationWithAnalyzersOptions(processedProject.AnalyzerOptions, null, true, false));
589589

590590
var diagnostics = await compilationWithAnalyzers.GetAllDiagnosticsAsync(cancellationToken).ConfigureAwait(false);
591591
return diagnostics;

0 commit comments

Comments
 (0)