Skip to content

Commit 7d66d79

Browse files
authored
Merge pull request #12 from Valks/master
Add <auto-generated /> tag so stylecop doesn't evaluate generated code.
2 parents 595ef75 + 9d799a2 commit 7d66d79

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/StringLiteralGenerator/Utf8StringLiteralGenerator.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ namespace StringLiteralGenerator
1212
[Generator]
1313
public class Utf8StringLiteralGenerator : ISourceGenerator
1414
{
15-
private const string attributeText = @"using System;
15+
private const string attributeText = @"// <auto-generated />
16+
using System;
1617
namespace StringLiteral
1718
{
1819
[System.Diagnostics.Conditional(""COMPILE_TIME_ONLY"")]
@@ -88,7 +89,7 @@ string getFilename(INamedTypeSymbol type)
8889
string generate(INamedTypeSymbol containingType, IEnumerable<(string methodName, string value, Accessibility accessibility)> methods)
8990
{
9091
buffer.Clear();
91-
92+
buffer.AppendLine("// <auto-generated />");
9293
if (!string.IsNullOrEmpty(containingType.ContainingNamespace.Name))
9394
{
9495
buffer.Append(@"namespace ");

0 commit comments

Comments
 (0)