Problem
Every DiagnosticAnalyzer in this repo calls:
context.ConfigureGeneratedCodeAnalysis(GeneratedCodeAnalysisFlags.Analyze | GeneratedCodeAnalysisFlags.None);
GeneratedCodeAnalysisFlags.None has value 0, so Analyze | None is bitwise-identical to Analyze alone. The intended flags were:
context.ConfigureGeneratedCodeAnalysis(GeneratedCodeAnalysisFlags.Analyze | GeneratedCodeAnalysisFlags.ReportDiagnostics);
Impact
With the current flags, each analyzer runs on generated code but silently suppresses its diagnostics on generated code. Any violation in source-generated classes (wrong visibility, prohibited type usage, etc.) produces no diagnostic.
Files affected
All *DiagnosticsAnalyzer.cs files in src/FunFair.CodeAnalysis/ — they all share the same Initialize pattern.
Fix
Replace GeneratedCodeAnalysisFlags.None with GeneratedCodeAnalysisFlags.ReportDiagnostics in the ConfigureGeneratedCodeAnalysis call in every analyzer.
Discovery
Found during code review of PR #446 (ClassVisibilityDiagnosticsAnalyzer.cs was the touched file that surfaced this).
Problem
Every
DiagnosticAnalyzerin this repo calls:GeneratedCodeAnalysisFlags.Nonehas value0, soAnalyze | Noneis bitwise-identical toAnalyzealone. The intended flags were:Impact
With the current flags, each analyzer runs on generated code but silently suppresses its diagnostics on generated code. Any violation in source-generated classes (wrong visibility, prohibited type usage, etc.) produces no diagnostic.
Files affected
All
*DiagnosticsAnalyzer.csfiles insrc/FunFair.CodeAnalysis/— they all share the sameInitializepattern.Fix
Replace
GeneratedCodeAnalysisFlags.NonewithGeneratedCodeAnalysisFlags.ReportDiagnosticsin theConfigureGeneratedCodeAnalysiscall in every analyzer.Discovery
Found during code review of PR #446 (
ClassVisibilityDiagnosticsAnalyzer.cswas the touched file that surfaced this).