chore(sonar)!: mark Markdown generator classes as 'public static class' (S1118)
SonarQube Analysis / sonarqube (pull_request) Successful in 4m22s
SonarQube Analysis / sonarqube (pull_request) Successful in 4m22s
After the CA1822 cascade in #15 left every method on the eight Markdown generator classes static, the classes themselves were instantiable shells that consumers couldn't usefully `new`. This commit flips the `class` modifier to `static class` on all eight: - `Markdown.SqlServer.QueryBreakdownGenerator` - `Markdown.SqlServer.SqlStatementGenerator` - `Markdown.LinqToSql.QueryBreakdownGenerator` - `Markdown.LinqToSql.SqlStatementGenerator` - `Markdown.PostgreSql.QueryBreakdownGenerator` - `Markdown.PostgreSql.SqlStatementGenerator` - `Markdown.Snowflake.QueryBreakdownGenerator` - `Markdown.Snowflake.SqlStatementGenerator` Test fixtures drop the now-meaningless `_generator = new …()` field and `[SetUp]` (kept the existing Setup body where unrelated state was also initialized — `QueryMarkdownGenerationTests` and `LinqToSql.QueryBreakdownGeneratorTests`). BREAKING CHANGE: External NuGet consumers can no longer write `new Markdown.Snowflake.SqlStatementGenerator()` (or any of the other seven classes above) — the type is now a static container and may only be referenced by name, e.g. `Markdown.Snowflake.SqlStatementGenerator.GenerateSequenceDiagram(…)`. The call syntax for the static methods is unchanged. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.7
parent
54b9c7876f
commit
423108a7dc
@@ -6,14 +6,6 @@ namespace Strata.SqlTools.Markdown.Tests.Snowflake;
|
||||
[TestFixture]
|
||||
public class QueryBreakdownGeneratorTests
|
||||
{
|
||||
private QueryBreakdownGenerator _generator = null!;
|
||||
|
||||
[SetUp]
|
||||
public void Setup()
|
||||
{
|
||||
_generator = new QueryBreakdownGenerator();
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void GenerateMermaidDiagram_SimpleSnowflakeQuery_GeneratesValidMermaid()
|
||||
{
|
||||
|
||||
@@ -6,14 +6,6 @@ namespace Strata.SqlTools.Markdown.Tests.Snowflake;
|
||||
[TestFixture]
|
||||
public class SqlStatementGeneratorTests
|
||||
{
|
||||
private SqlStatementGenerator _generator = null!;
|
||||
|
||||
[SetUp]
|
||||
public void Setup()
|
||||
{
|
||||
_generator = new SqlStatementGenerator();
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void GenerateSequenceDiagram_SnowflakeQuery_GeneratesValidDiagram()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user