Skip to content

Commit b8dbde4

Browse files
johnml1135claude
andcommitted
Fix CSharpier formatting violations from recent HermitCrab changes
CI's "Check formatting" step was failing because several files from the recent parse-optimization commits weren't run through `dotnet csharpier format`. No logic changes, just re-wrapping to match the enforced style. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
1 parent 93e52dc commit b8dbde4

5 files changed

Lines changed: 17 additions & 10 deletions

File tree

src/SIL.Machine.Morphology.HermitCrab/AnalysisStateKey.cs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -87,10 +87,7 @@ public bool Equals(AnalysisStateKey other)
8787
return false;
8888
if (!_shape.ValueEquals(other._shape))
8989
return false;
90-
if (
91-
!_syntacticFS.ValueEquals(other._syntacticFS)
92-
|| !_realizationalFS.ValueEquals(other._realizationalFS)
93-
)
90+
if (!_syntacticFS.ValueEquals(other._syntacticFS) || !_realizationalFS.ValueEquals(other._realizationalFS))
9491
return false;
9592
return RuleCountsEqual(_ruleCounts, other._ruleCounts);
9693
}

src/SIL.Machine.Morphology.HermitCrab/GrammarAnalyzer.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,11 @@ public static class GrammarAnalyzer
5656
if (stratum.MorphologicalRules.OfType<CompoundingRule>().Any())
5757
return null;
5858

59-
int longestRoot = stratum.Entries.SelectMany(e => e.Allomorphs).Select(SegmentCount).DefaultIfEmpty(0).Max();
59+
int longestRoot = stratum
60+
.Entries.SelectMany(e => e.Allomorphs)
61+
.Select(SegmentCount)
62+
.DefaultIfEmpty(0)
63+
.Max();
6064
bound += longestRoot;
6165

6266
foreach (AffixProcessRule rule in stratum.MorphologicalRules.OfType<AffixProcessRule>())

src/SIL.Machine.Morphology.HermitCrab/MemoizedCombinationRuleCascade.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,11 @@ private List<Word> ApplyRules(Word input, HashSet<Word> output)
7575
var replayed = new List<Word>(entry.Results.Count);
7676
foreach (Word storedResult in entry.Results)
7777
{
78-
Word replay = storedResult.ReplayOnto(input, entry.MruleTrailPrefixLength, entry.NonHeadPrefixLength);
78+
Word replay = storedResult.ReplayOnto(
79+
input,
80+
entry.MruleTrailPrefixLength,
81+
entry.NonHeadPrefixLength
82+
);
7983
output.Add(replay);
8084
replayed.Add(replay);
8185
}

tests/SIL.Machine.Morphology.HermitCrab.Tests/MorpherTests.cs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -775,9 +775,7 @@ public void EnableLexicalGating_MatchesDisabled_SimpleAffixGrammar()
775775
List<Word> onResult = gateOn.ParseWord(word).ToList();
776776
Assert.That(
777777
onResult.Select(WordResultSignature).OrderBy(s => s, System.StringComparer.Ordinal),
778-
Is.EqualTo(
779-
offResult.Select(WordResultSignature).OrderBy(s => s, System.StringComparer.Ordinal)
780-
),
778+
Is.EqualTo(offResult.Select(WordResultSignature).OrderBy(s => s, System.StringComparer.Ordinal)),
781779
$"lexical-gate-on parse of '{word}' must match gate-off parse"
782780
);
783781
}

tests/SIL.Machine.Morphology.HermitCrab.Tests/PhonologicalRules/RewriteRuleTests.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1380,7 +1380,11 @@ public void EpenthesisRuleWithMinimalLexicon()
13801380
Name = "Allophonic",
13811381
MorphologicalRuleOrder = MorphologicalRuleOrder.Unordered,
13821382
};
1383-
var surface = new Stratum(Table1) { Name = "Surface", MorphologicalRuleOrder = MorphologicalRuleOrder.Unordered };
1383+
var surface = new Stratum(Table1)
1384+
{
1385+
Name = "Surface",
1386+
MorphologicalRuleOrder = MorphologicalRuleOrder.Unordered,
1387+
};
13841388

13851389
var entry = new LexEntry
13861390
{

0 commit comments

Comments
 (0)