Skip to content

Commit fca4f76

Browse files
committed
NIT: Improve constant message
1 parent c1f7943 commit fca4f76

File tree

7 files changed

+27
-10
lines changed

7 files changed

+27
-10
lines changed

tracer/src/Datadog.Trace.SourceGenerators/Configuration/ConfigKeyAliasesSwitcherGenerator.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,9 +176,9 @@ private static CompilationUnitSyntax GenerateConfigurationKeyMatcher(Configurati
176176
.WithModifiers(TokenList(Token(SyntaxKind.InternalKeyword), Token(SyntaxKind.StaticKeyword), Token(SyntaxKind.PartialKeyword)))
177177
.WithLeadingTrivia(
178178
Comment(Constants.FileHeader),
179+
Comment(Constants.ConfigurationGeneratorComment),
179180
Comment("/// <summary>"),
180181
Comment("/// Generated configuration key matcher that handles main keys and aliases."),
181-
Comment("/// This file is auto-generated from supported-configurations.json and supported-configurations-docs.yaml. Do not edit this file directly. The source generator will regenerate it on build."),
182182
Comment("/// </summary>"))
183183
.WithMembers(
184184
List<MemberDeclarationSyntax>(

tracer/src/Datadog.Trace.SourceGenerators/Configuration/ConfigurationKeysGenerator.cs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -330,10 +330,7 @@ private static Dictionary<string, ConfigEntry> ParseConfigurationEntries(string
330330
private static void AppendFileHeader(StringBuilder sb)
331331
{
332332
sb.Append(Constants.FileHeader);
333-
sb.AppendLine("// This file is auto-generated from supported-configurations.json and supported-configurations-docs.yaml");
334-
sb.AppendLine("// Do not edit this file directly. The source generator will regenerate it on build.");
335-
sb.AppendLine("// NOTE: If you remove keys/products from the JSON, run 'dotnet clean' to remove old generated files.");
336-
sb.AppendLine();
333+
sb.Append(Constants.ConfigurationGeneratorComment);
337334
}
338335

339336
private static string GenerateProductPartialClass(string product, List<KeyValuePair<string, ConfigEntry>> entries)

tracer/src/Datadog.Trace.SourceGenerators/Constants.cs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// <copyright file="Constants.cs" company="Datadog">
1+
// <copyright file="Constants.cs" company="Datadog">
22
// Unless explicitly stated otherwise all files in this repository are licensed under the Apache 2 License.
33
// This product includes software developed at Datadog (https://www.datadoghq.com/). Copyright 2017 Datadog, Inc.
44
// </copyright>
@@ -20,5 +20,13 @@ internal static class Constants
2020
#nullable enable
2121
2222
23+
""";
24+
25+
public const string ConfigurationGeneratorComment =
26+
"""
27+
// This file is auto-generated from supported-configurations.json and supported-configurations-docs.yaml
28+
// Do not edit this file directly. The source generator will regenerate it on build.
29+
// NOTE: If you remove keys/products from the JSON, run 'dotnet clean' and remove old generated files.
30+
2331
""";
2432
}

tracer/src/Datadog.Trace/Generated/net461/Datadog.Trace.SourceGenerators/ConfigKeyAliasesSwitcherGenerator/ConfigKeyAliasesSwitcher.g.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,12 @@ namespace Datadog.Trace.Configuration;
1010
#nullable enable
1111

1212

13+
// This file is auto-generated from supported-configurations.json and supported-configurations-docs.yaml
14+
// Do not edit this file directly. The source generator will regenerate it on build.
15+
// NOTE: If you remove keys/products from the JSON, run 'dotnet clean' and remove old generated files.
16+
1317
/// <summary>
1418
/// Generated configuration key matcher that handles main keys and aliases.
15-
/// This file is auto-generated from supported-configurations.json and supported-configurations-docs.yaml. Do not edit this file directly. The source generator will regenerate it on build.
1619
/// </summary>
1720
internal static partial class ConfigKeyAliasesSwitcher
1821
{

tracer/src/Datadog.Trace/Generated/net6.0/Datadog.Trace.SourceGenerators/ConfigKeyAliasesSwitcherGenerator/ConfigKeyAliasesSwitcher.g.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,12 @@ namespace Datadog.Trace.Configuration;
1010
#nullable enable
1111

1212

13+
// This file is auto-generated from supported-configurations.json and supported-configurations-docs.yaml
14+
// Do not edit this file directly. The source generator will regenerate it on build.
15+
// NOTE: If you remove keys/products from the JSON, run 'dotnet clean' and remove old generated files.
16+
1317
/// <summary>
1418
/// Generated configuration key matcher that handles main keys and aliases.
15-
/// This file is auto-generated from supported-configurations.json and supported-configurations-docs.yaml. Do not edit this file directly. The source generator will regenerate it on build.
1619
/// </summary>
1720
internal static partial class ConfigKeyAliasesSwitcher
1821
{

tracer/src/Datadog.Trace/Generated/netcoreapp3.1/Datadog.Trace.SourceGenerators/ConfigKeyAliasesSwitcherGenerator/ConfigKeyAliasesSwitcher.g.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,12 @@ namespace Datadog.Trace.Configuration;
1010
#nullable enable
1111

1212

13+
// This file is auto-generated from supported-configurations.json and supported-configurations-docs.yaml
14+
// Do not edit this file directly. The source generator will regenerate it on build.
15+
// NOTE: If you remove keys/products from the JSON, run 'dotnet clean' and remove old generated files.
16+
1317
/// <summary>
1418
/// Generated configuration key matcher that handles main keys and aliases.
15-
/// This file is auto-generated from supported-configurations.json and supported-configurations-docs.yaml. Do not edit this file directly. The source generator will regenerate it on build.
1619
/// </summary>
1720
internal static partial class ConfigKeyAliasesSwitcher
1821
{

tracer/src/Datadog.Trace/Generated/netstandard2.0/Datadog.Trace.SourceGenerators/ConfigKeyAliasesSwitcherGenerator/ConfigKeyAliasesSwitcher.g.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,12 @@ namespace Datadog.Trace.Configuration;
1010
#nullable enable
1111

1212

13+
// This file is auto-generated from supported-configurations.json and supported-configurations-docs.yaml
14+
// Do not edit this file directly. The source generator will regenerate it on build.
15+
// NOTE: If you remove keys/products from the JSON, run 'dotnet clean' and remove old generated files.
16+
1317
/// <summary>
1418
/// Generated configuration key matcher that handles main keys and aliases.
15-
/// This file is auto-generated from supported-configurations.json and supported-configurations-docs.yaml. Do not edit this file directly. The source generator will regenerate it on build.
1619
/// </summary>
1720
internal static partial class ConfigKeyAliasesSwitcher
1821
{

0 commit comments

Comments
 (0)