Skip to content

Commit

Permalink
Add [GeneratedCode] and [ExcludeFromCodeCoverage] Attributes to S…
Browse files Browse the repository at this point in the history
…ourceGenerators (#251)

Add Attributes
  • Loading branch information
brminnick authored Oct 22, 2023
1 parent 8dfa6b4 commit 93b1411
Showing 1 changed file with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -84,13 +84,19 @@ static void Execute(SourceProductionContext context, [NotNull] TextAlignmentClas
{
throw new ArgumentNullException(nameof(textAlignmentClassMetadata));
}

var className = typeof(TextAlignmentExtensionsGenerator).FullName;
var assemblyVersion = typeof(TextAlignmentExtensionsGenerator).Assembly.GetName().Version.ToString();

var genericTypeParameters = GetGenericTypeParametersDeclarationString(textAlignmentClassMetadata.GenericArguments);
var genericArguments = GetGenericArgumentsString(textAlignmentClassMetadata.GenericArguments);
var source = $$"""
// <auto-generated>
// See: CommunityToolkit.Maui.Markup.SourceGenerators.TextAlignmentGenerator

#nullable enable
#pragma warning disable

using System;
using Microsoft.Maui;
using Microsoft.Maui.Controls;
Expand All @@ -100,6 +106,8 @@ namespace CommunityToolkit.Maui.Markup
/// <summary>
/// Extension Methods for <see cref="ITextAlignment"/>
/// </summary>
[global::System.CodeDom.Compiler.GeneratedCode("{{className}}", "{{assemblyVersion}}")]
[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
{{textAlignmentClassMetadata.ClassAcessModifier}} static partial class TextAlignmentExtensions_{{textAlignmentClassMetadata.ClassName}}
{
/// <summary>
Expand Down Expand Up @@ -235,6 +243,8 @@ namespace LeftToRight
/// <summary>
/// Extension Methods for <see cref="ITextAlignment"/>
/// </summary>
[global::System.CodeDom.Compiler.GeneratedCode("{{className}}", "{{assemblyVersion}}")]
[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
{{textAlignmentClassMetadata.ClassAcessModifier}} static partial class TextAlignmentExtensions_{{textAlignmentClassMetadata.ClassName}}
{
/// <summary>
Expand Down

0 comments on commit 93b1411

Please sign in to comment.