Last active
August 29, 2015 14:21
-
-
Save jmarolf/b017f7032ea0369d4037 to your computer and use it in GitHub Desktop.
Change default severity
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
var compilation = project.GetCompilationAsync().Result; | |
var specificDiagnosticOptions = new[] { new KeyValuePair<string, ReportDiagnostic>(NotReportedByDefaultAnalyzer.DiagnosticId, ReportDiagnostic.Warn) }; | |
var options = new CSharpCompilationOptions(outputKind: OutputKind.DynamicallyLinkedLibrary, specificDiagnosticOptions: specificDiagnosticOptions); | |
var compilationWithOptions = compilation.WithOptions(options); | |
var compilationWithAnalyzers = compilationWithOptions.WithAnalyzers(ImmutableArray.Create(analyzer)); | |
var diags = compilationWithAnalyzers.GetAnalyzerDiagnosticsAsync().Result; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment