Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix: inconsistent tabs vs spaces
  • Loading branch information
Flash0ver committed Jul 9, 2025
commit ab6fa45ef71f463e8224f1aa187a1f60d2cd00f2
8 changes: 5 additions & 3 deletions src/Sentry.SourceGenerators/BuildPropertySourceGenerator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ public void Initialize(GeneratorInitializationContext context)
/// </summary>
public void Execute(GeneratorExecutionContext context)
{
const string tabString = " ";

var opts = context.AnalyzerConfigOptions.GlobalOptions;
var properties = opts.Keys.Where(x => x.StartsWith("build_property.")).ToList();
if (properties.Count == 0)
Expand Down Expand Up @@ -73,15 +75,15 @@ public static void Initialize()
var pn = EscapeString(property.Replace("build_property.", ""));
var ev = EscapeString(value);
sb
.Append("\t\t\t{")
.Append($"{tabString}{tabString}{tabString}{{")
.Append($"\"{pn}\", \"{ev}\"")
.AppendLine("},");
}
}

sb
.AppendLine("\t\t});") // close dictionary
.AppendLine("\t}")
.AppendLine($"{tabString}{tabString}}});") // close dictionary
.AppendLine($"{tabString}}}")
.AppendLine("}")
.AppendLine("#endif");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
SyntaxTree: {
FilePath: Sentry.SourceGenerators/Sentry.SourceGenerators.BuildPropertySourceGenerator/Sentry.Generated.BuildPropertyInitializer.g.cs,
Encoding: utf-8,
Length: 680,
Length: 698,
HasCompilationUnitRoot: true,
Options: {
LanguageVersion: CSharp12,
Expand Down Expand Up @@ -34,13 +34,13 @@ public static class BuildPropertyInitializer
{
global::Sentry.CompilerServices.BuildProperties.Initialize(new global::System.Collections.Generic.Dictionary<string, string>(global::System.StringComparer.OrdinalIgnoreCase)
{
{"My\\Key", "test\\test"},
});
}
{"My\\Key", "test\\test"},
});
}
}
#endif
,
Length: 680,
Length: 698,
ChecksumAlgorithm: Sha1,
CanBeEmbedded: true,
Container: {},
Expand Down Expand Up @@ -280,83 +280,83 @@ public static class BuildPropertyInitializer
{
LineNumber: 17,
Start: 632,
End: 661,
EndIncludingLineBreak: 662,
End: 670,
EndIncludingLineBreak: 671,
Span: {
Start: 632,
Length: 29
Length: 38
},
SpanIncludingLineBreak: {
Start: 632,
Length: 30
Length: 39
}
},
{
LineNumber: 18,
Start: 662,
End: 667,
EndIncludingLineBreak: 668,
Start: 671,
End: 682,
EndIncludingLineBreak: 683,
Span: {
Start: 662,
Length: 5
Start: 671,
Length: 11
},
SpanIncludingLineBreak: {
Start: 662,
Length: 6
Start: 671,
Length: 12
}
},
{
LineNumber: 19,
Start: 668,
End: 670,
EndIncludingLineBreak: 671,
Start: 683,
End: 688,
EndIncludingLineBreak: 689,
Span: {
Start: 668,
Length: 2
Start: 683,
Length: 5
},
SpanIncludingLineBreak: {
Start: 668,
Length: 3
Start: 683,
Length: 6
}
},
{
LineNumber: 20,
Start: 671,
End: 672,
EndIncludingLineBreak: 673,
Start: 689,
End: 690,
EndIncludingLineBreak: 691,
Span: {
Start: 671,
Start: 689,
Length: 1
},
SpanIncludingLineBreak: {
Start: 671,
Start: 689,
Length: 2
}
},
{
LineNumber: 21,
Start: 673,
End: 679,
EndIncludingLineBreak: 680,
Start: 691,
End: 697,
EndIncludingLineBreak: 698,
Span: {
Start: 673,
Start: 691,
Length: 6
},
SpanIncludingLineBreak: {
Start: 673,
Start: 691,
Length: 7
}
},
{
LineNumber: 22,
Start: 680,
End: 680,
EndIncludingLineBreak: 680,
Start: 698,
End: 698,
EndIncludingLineBreak: 698,
Span: {
Start: 680
Start: 698
},
SpanIncludingLineBreak: {
Start: 680
Start: 698
}
}
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
SyntaxTree: {
FilePath: Sentry.SourceGenerators/Sentry.SourceGenerators.BuildPropertySourceGenerator/Sentry.Generated.BuildPropertyInitializer.g.cs,
Encoding: utf-8,
Length: 677,
Length: 695,
HasCompilationUnitRoot: true,
Options: {
LanguageVersion: CSharp12,
Expand Down Expand Up @@ -34,13 +34,13 @@ public static class BuildPropertyInitializer
{
global::Sentry.CompilerServices.BuildProperties.Initialize(new global::System.Collections.Generic.Dictionary<string, string>(global::System.StringComparer.OrdinalIgnoreCase)
{
{"PublishAot", "true"},
});
}
{"PublishAot", "true"},
});
}
}
#endif
,
Length: 677,
Length: 695,
ChecksumAlgorithm: Sha1,
CanBeEmbedded: true,
Container: {},
Expand Down Expand Up @@ -280,83 +280,83 @@ public static class BuildPropertyInitializer
{
LineNumber: 17,
Start: 632,
End: 658,
EndIncludingLineBreak: 659,
End: 667,
EndIncludingLineBreak: 668,
Span: {
Start: 632,
Length: 26
Length: 35
},
SpanIncludingLineBreak: {
Start: 632,
Length: 27
Length: 36
}
},
{
LineNumber: 18,
Start: 659,
End: 664,
EndIncludingLineBreak: 665,
Start: 668,
End: 679,
EndIncludingLineBreak: 680,
Span: {
Start: 659,
Length: 5
Start: 668,
Length: 11
},
SpanIncludingLineBreak: {
Start: 659,
Length: 6
Start: 668,
Length: 12
}
},
{
LineNumber: 19,
Start: 665,
End: 667,
EndIncludingLineBreak: 668,
Start: 680,
End: 685,
EndIncludingLineBreak: 686,
Span: {
Start: 665,
Length: 2
Start: 680,
Length: 5
},
SpanIncludingLineBreak: {
Start: 665,
Length: 3
Start: 680,
Length: 6
}
},
{
LineNumber: 20,
Start: 668,
End: 669,
EndIncludingLineBreak: 670,
Start: 686,
End: 687,
EndIncludingLineBreak: 688,
Span: {
Start: 668,
Start: 686,
Length: 1
},
SpanIncludingLineBreak: {
Start: 668,
Start: 686,
Length: 2
}
},
{
LineNumber: 21,
Start: 670,
End: 676,
EndIncludingLineBreak: 677,
Start: 688,
End: 694,
EndIncludingLineBreak: 695,
Span: {
Start: 670,
Start: 688,
Length: 6
},
SpanIncludingLineBreak: {
Start: 670,
Start: 688,
Length: 7
}
},
{
LineNumber: 22,
Start: 677,
End: 677,
EndIncludingLineBreak: 677,
Start: 695,
End: 695,
EndIncludingLineBreak: 695,
Span: {
Start: 677
Start: 695
},
SpanIncludingLineBreak: {
Start: 677
Start: 695
}
}
]
Expand Down
Loading