From f993401f0ea526caa95538bfb302b60eed7aa8bb Mon Sep 17 00:00:00 2001 From: Daniel Cazzulino Date: Wed, 30 Aug 2023 16:21:55 -0300 Subject: [PATCH] Apply dotnet format --- src/ThisAssembly.Constants/Model.cs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/ThisAssembly.Constants/Model.cs b/src/ThisAssembly.Constants/Model.cs index f8664985..b48f7631 100644 --- a/src/ThisAssembly.Constants/Model.cs +++ b/src/ThisAssembly.Constants/Model.cs @@ -18,14 +18,14 @@ record Area(string Name, string Prefix) { public List NestedAreas { get; init; } = new(); public List Values { get; init; } = new(); - - private static string EscapeIdentifier(string identifier) + + static string EscapeIdentifier(string identifier) { if (string.IsNullOrWhiteSpace(identifier)) { return "_"; } - + var replaced = identifier .Select(c => SyntaxFacts.IsIdentifierPartCharacter(c) ? c : '_') .ToArray(); @@ -35,7 +35,7 @@ private static string EscapeIdentifier(string identifier) if (!SyntaxFacts.IsIdentifierStartCharacter(result[0])) { result = "_" + result; - } + } return result; } @@ -50,7 +50,7 @@ public static Area Load(List constants, string rootArea = "Constants") var parts = constant.Name.Split(new[] { "." }, StringSplitOptions.RemoveEmptyEntries) .Select(EscapeIdentifier) .ToArray(); - + if (parts.Length <= 1) { root.Values.Add(constant with { Name = EscapeIdentifier(constant.Name) });