chore(sonar)!: cascade CA1822 through Markdown dialect wrappers
SonarQube Analysis / sonarqube (pull_request) Successful in 2m50s

Commit 5202d93 made the SqlServer-namespaced Markdown generator methods
static, which left the LinqToSql / PostgreSql / Snowflake wrapper
classes' instance methods delegating to nothing but a static call.
SonarQube re-flagged those 10 wrapper methods as CA1822 on the next
scan.

This sweep:

- Makes all 10 wrapper instance methods `static` (`dotnet format` driven).
- Makes `Markdown.LinqToSql.QueryBreakdownGenerator.GenerateCombinedDiagram`
  static preemptively — it composes two static helpers and would otherwise
  be the next-iteration cascade flag.
- Removes the now-dead `_baseGenerator` field and its initializing
  constructor from all six dialect wrappers (LinqToSql / PostgreSql /
  Snowflake × QueryBreakdownGenerator + SqlStatementGenerator). The
  classes keep their implicit parameterless constructor so `new
  Snowflake.QueryBreakdownGenerator()` still compiles.
- Updates the one test call site (`GenerateCombinedDiagram`) the fixer
  didn't catch to use type-name form.

BREAKING CHANGE: External NuGet consumers calling
`instance.Generate*Diagram(...)` on `Markdown.LinqToSql.*`,
`Markdown.PostgreSql.*`, or `Markdown.Snowflake.*` generators must
switch to type-name form, e.g. `Markdown.Snowflake.SqlStatementGenerator.GenerateSequenceDiagram(...)`.
The class types and parameterless constructors remain — only the call
syntax for these methods changes.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
Thom Lamb
2026-05-27 14:38:58 -05:00
co-authored by Claude Opus 4.7
parent 3ba7a7e9f3
commit 6175dcde96
14 changed files with 59 additions and 119 deletions
@@ -87,7 +87,7 @@ public class SqlStatementGeneratorTests
var query = new LinqQueryBreakdown("*", "Users");
// Act
var result = _generator.GenerateSequenceDiagram(query, "Sequence Test");
var result = SqlStatementGenerator.GenerateSequenceDiagram(query, "Sequence Test");
// Assert
Assert.That(result, Does.Contain("```mermaid"));
@@ -102,7 +102,7 @@ public class SqlStatementGeneratorTests
var query = new LinqQueryBreakdown("Id, Name", "Users");
// Act
var result = _generator.GenerateEntityRelationshipDiagram(query, "ER Test");
var result = SqlStatementGenerator.GenerateEntityRelationshipDiagram(query, "ER Test");
// Assert
Assert.That(result, Does.Contain("```mermaid"));