Skip to content

Commit

Permalink
Fixes pragma warning restore of CS1591 (#221)
Browse files Browse the repository at this point in the history
* Fixes pragma warning restore of CS1591
  • Loading branch information
domn1995 authored Jan 29, 2024
1 parent 13565f3 commit 019328e
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

<PropertyGroup>
<Nullable>enable</Nullable>
<Version>1.11.1</Version>
<Version>1.11.2</Version>
<SignAssembly>False</SignAssembly>
</PropertyGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public static string GenerateExtensions(UnionDeclaration union)

return new StringBuilder()
.AppendAutoGeneratedCommentLine()
.AppendPragmaWarningDisableCa1591Line()
.AppendPragmaWarningDisableCs1591Line()
.AppendUsingStatements(union)
.AppendLine()
.AppendLine($"namespace {union.Namespace};")
Expand All @@ -36,7 +36,7 @@ public static string GenerateExtensions(UnionDeclaration union)
.AppendSpecificMatchAsyncMethodForActions(union, task)
.AppendSpecificMatchAsyncMethodForActions(union, valueTask)
.AppendLine("}")
.AppendPragmaWarningRestoreCa1591Line()
.AppendPragmaWarningRestoreCs1591Line()
.ToString();
}

Expand Down
10 changes: 5 additions & 5 deletions src/Dunet.Generator/UnionGeneration/StringBuilderExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -56,15 +56,15 @@ public static StringBuilder AppendGeneratedCodeAttributeLine(this StringBuilder
$$"""[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Dunet.Generator", "{{GeneratorVersion}}")]"""
);

public static StringBuilder AppendPragmaWarningDisableCa1591Line(this StringBuilder builder) =>
public static StringBuilder AppendPragmaWarningDisableCs1591Line(this StringBuilder builder) =>
builder
.AppendLine("// Disable CA1591 - Missing XML comment on public member")
.AppendLine("// Disable CS1591 - Missing XML comment on public member")
.AppendLine("#pragma warning disable 1591");

public static StringBuilder AppendPragmaWarningRestoreCa1591Line(this StringBuilder builder) =>
public static StringBuilder AppendPragmaWarningRestoreCs1591Line(this StringBuilder builder) =>
builder
.AppendLine("// Disable CA1591 - Missing XML comment on public member")
.AppendLine("#pragma warning enable 1591");
.AppendLine("// Disable CS1591 - Missing XML comment on public member")
.AppendLine("#pragma warning restore 1591");

private static string? GeneratorVersion { get; } = GetGeneratorVersion();

Expand Down
4 changes: 2 additions & 2 deletions src/Dunet.Generator/UnionGeneration/UnionSourceBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ public static string Build(UnionDeclaration union)
{
var builder = new StringBuilder();

builder.AppendAutoGeneratedCommentLine().AppendPragmaWarningDisableCa1591Line();
builder.AppendAutoGeneratedCommentLine().AppendPragmaWarningDisableCs1591Line();

foreach (var import in union.Imports)
{
Expand Down Expand Up @@ -75,7 +75,7 @@ public static string Build(UnionDeclaration union)
builder.AppendLine("}");
}

builder.AppendPragmaWarningRestoreCa1591Line();
builder.AppendPragmaWarningRestoreCs1591Line();

return builder.ToString();
}
Expand Down

0 comments on commit 019328e

Please sign in to comment.