Skip to content

Commit

Permalink
Exclude generated files from code analysis via auto-generated tag
Browse files Browse the repository at this point in the history
  • Loading branch information
rutgersc committed Oct 20, 2021
1 parent e0f1283 commit 6042623
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions OneOf.SourceGenerator/OneOfGenerator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ public class OneOfGenerator : ISourceGenerator
private const string AttributeName = "GenerateOneOfAttribute";
private const string AttributeNamespace = "OneOf";

private readonly string _attributeText = $@"using System;
private readonly string _attributeText = $@"// <auto-generated />
using System;
namespace {AttributeNamespace}
{{
Expand Down Expand Up @@ -132,7 +133,8 @@ private static string GenerateClassSource(INamedTypeSymbol classSymbol,

string classNameWithGenericTypes = $"{classSymbol.Name}{GetOpenGenericPart(classSymbol)}";

StringBuilder source = new($@"using System;
StringBuilder source = new($@"// <auto-generated />
using System;
namespace {classSymbol.ContainingNamespace.ToDisplayString()}
{{
Expand Down

0 comments on commit 6042623

Please sign in to comment.