Exemplo n.º 1
0
        /// <summary>
        /// Check the solution for compiler errors and warnings, uses:
        /// DiagnosticSettings.AllowedErrorIds()
        /// DiagnosticSettings.AllowedDiagnostics().
        /// </summary>
        /// <param name="metadataReferences">A collection of <see cref="MetadataReference"/> to use when compiling. Default is <see langword="null" /> meaning <see cref="MetadataReferences"/> are used.</param>
        /// <param name="code">The code to analyze.</param>
        public static void NoCompilerErrors(IEnumerable <MetadataReference> metadataReferences, params string[] code)
        {
#pragma warning disable CS0618 // Suppress until removed. Will be replaced with Metadatareferences.FromAttributes()
            var solution = CodeFactory.CreateSolution(code, metadataReferences);
            NoCompilerErrors(solution, SuppressedDiagnostics, DiagnosticSettings.AllowedDiagnostics());
#pragma warning restore CS0618 // Suppress until removed. Will be replaced with Metadatareferences.FromAttributes()
        }
Exemplo n.º 2
0
        private static void NoDiagnosticsOrErrors(Analyze.DiagnosticsAndErrors diagnosticsAndErrors)
        {
            NoDiagnostics(diagnosticsAndErrors.AnalyzerDiagnostics);
#pragma warning disable CS0618 // Suppress until removed. Will be replaced with Metadatareferences.FromAttributes()
            NoCompilerErrors(diagnosticsAndErrors.Errors, SuppressedDiagnostics, DiagnosticSettings.AllowedDiagnostics());
#pragma warning restore CS0618 // Suppress until removed. Will be replaced with Metadatareferences.FromAttributes()
        }
Exemplo n.º 3
0
 private static bool IsIncluded(Diagnostic diagnostic)
 {
     return(IsIncluded(diagnostic, DiagnosticSettings.AllowedDiagnostics()));
 }
 /// <summary>
 /// Check the solution for compiler errors and warnings, uses:
 /// DiagnosticSettings.AllowedErrorIds()
 /// DiagnosticSettings.AllowedDiagnostics().
 /// </summary>
 public static void NoCompilerErrors(Solution solution)
 {
     NoCompilerErrors(solution, DiagnosticSettings.AllowedErrorIds(), DiagnosticSettings.AllowedDiagnostics());
 }
        /// <summary>
        /// Check the solution for compiler errors and warnings, uses:
        /// DiagnosticSettings.AllowedErrorIds()
        /// DiagnosticSettings.AllowedDiagnostics().
        /// </summary>
        public static void NoCompilerErrors(IEnumerable <MetadataReference> metadataReferences, params string[] code)
        {
            var solution = CodeFactory.CreateSolution(code, metadataReferences);

            NoCompilerErrors(solution, DiagnosticSettings.AllowedErrorIds(), DiagnosticSettings.AllowedDiagnostics());
        }
Exemplo n.º 6
0
        /// <summary>
        /// Check the solution for compiler errors and warnings, uses:
        /// DiagnosticSettings.AllowedErrorIds()
        /// DiagnosticSettings.AllowedDiagnostics().
        /// </summary>
        public static void NoCompilerErrors(Solution solution)
        {
#pragma warning disable CS0618 // Suppress until removed. Will be replaced with Metadatareferences.FromAttributes()
            NoCompilerErrors(solution, SuppressedDiagnostics, DiagnosticSettings.AllowedDiagnostics());
#pragma warning restore CS0618 // Suppress until removed. Will be replaced with Metadatareferences.FromAttributes()
        }
Exemplo n.º 7
0
 /// <summary>
 /// Check the solution for compiler errors and warnings, uses:
 /// DiagnosticSettings.AllowedErrorIds()
 /// DiagnosticSettings.AllowedDiagnostics()
 /// </summary>
 public static Task NoCompilerErrorsAsync(Solution solution)
 {
     return(NoCompilerErrorsAsync(solution, DiagnosticSettings.AllowedErrorIds(), DiagnosticSettings.AllowedDiagnostics()));
 }
Exemplo n.º 8
0
 /// <summary>
 /// Check the solution for compiler errors and warnings, uses:
 /// DiagnosticSettings.AllowedErrorIds()
 /// DiagnosticSettings.AllowedDiagnostics()
 /// </summary>
 public static void NoCompilerErrors(Solution solution)
 {
     NoCompilerErrorsAsync(solution, DiagnosticSettings.AllowedErrorIds(), DiagnosticSettings.AllowedDiagnostics()).GetAwaiter().GetResult();
 }
Exemplo n.º 9
0
        /// <summary>
        /// Check the solution for compiler errors and warnings, uses:
        /// DiagnosticSettings.AllowedErrorIds()
        /// DiagnosticSettings.AllowedDiagnostics()
        /// </summary>
        public static void NoCompilerErrors(IReadOnlyList <MetadataReference> metadataReferences, params string[] code)
        {
            var solution = CodeFactory.CreateSolution(code, metadataReferences);

            NoCompilerErrorsAsync(solution, DiagnosticSettings.AllowedErrorIds(), DiagnosticSettings.AllowedDiagnostics()).GetAwaiter().GetResult();
        }
 private static void NoDiagnosticsOrErrors(Analyze.DiagnosticsAndErrors diagnosticsAndErrors)
 {
     NoDiagnostics(diagnosticsAndErrors.AnalyzerDiagnostics);
     NoCompilerErrors(diagnosticsAndErrors.Errors, DiagnosticSettings.AllowedErrorIds(), DiagnosticSettings.AllowedDiagnostics());
 }