style: apply CSharpier formatting to all C# sources

Repo-wide sweep with the pinned CSharpier 1.3.0 tool. Whitespace and
line-wrapping only; OpenNest.Engine.Tests (109) and OpenNest.IO.Tests
pass after reformat, full solution builds 0 errors.

Added .csharpierignore so csproj/config XML keeps its existing layout
(CSharpier's XML wrapping churns attributes with zero benefit).

Formatting is now enforceable: dotnet csharpier check . passes.
This commit is contained in:
aj
2026-09-20 16:41:50 -04:00
parent 8e6fa677fb
commit aec0523062
476 changed files with 16592 additions and 7800 deletions
+2 -4
View File
@@ -90,8 +90,7 @@
a1 = Angle.NormalizeRad(angle - a1);
a2 = Angle.NormalizeRad(a2 - angle);
return diff >= a1 - Tolerance.Epsilon ||
diff >= a2 - Tolerance.Epsilon;
return diff >= a1 - Tolerance.Epsilon || diff >= a2 - Tolerance.Epsilon;
}
/// <summary>
@@ -116,8 +115,7 @@
a1 = Angle.NormalizeRad(angle - a1);
a2 = Angle.NormalizeRad(a2 - angle);
return diff >= a1 - Tolerance.Epsilon ||
diff >= a2 - Tolerance.Epsilon;
return diff >= a1 - Tolerance.Epsilon || diff >= a2 - Tolerance.Epsilon;
}
}
}
+30 -9
View File
@@ -10,13 +10,18 @@ namespace OpenNest.Math
/// </summary>
public static class ExpressionEvaluator
{
public static double Evaluate(string expression, IReadOnlyDictionary<string, double> variables)
public static double Evaluate(
string expression,
IReadOnlyDictionary<string, double> variables
)
{
var parser = new Parser(expression, variables);
var result = parser.ParseExpression();
parser.SkipWhitespace();
if (!parser.IsEnd)
throw new FormatException($"Unexpected character at position {parser.Position}: '{parser.Current}'");
throw new FormatException(
$"Unexpected character at position {parser.Position}: '{parser.Current}'"
);
return result;
}
@@ -52,10 +57,12 @@ namespace OpenNest.Math
while (true)
{
SkipWhitespace();
if (IsEnd) break;
if (IsEnd)
break;
var op = Current;
if (op != '+' && op != '-') break;
if (op != '+' && op != '-')
break;
_pos++;
SkipWhitespace();
@@ -75,10 +82,12 @@ namespace OpenNest.Math
while (true)
{
SkipWhitespace();
if (IsEnd) break;
if (IsEnd)
break;
var op = Current;
if (op != '*' && op != '/') break;
if (op != '*' && op != '/')
break;
_pos++;
SkipWhitespace();
@@ -129,7 +138,10 @@ namespace OpenNest.Math
{
_pos++; // consume '$'
var start = _pos;
while (_pos < _input.Length && (char.IsLetterOrDigit(_input[_pos]) || _input[_pos] == '_'))
while (
_pos < _input.Length
&& (char.IsLetterOrDigit(_input[_pos]) || _input[_pos] == '_')
)
_pos++;
if (_pos == start)
throw new FormatException("Expected variable name after '$'.");
@@ -145,10 +157,19 @@ namespace OpenNest.Math
_pos++;
if (_pos == numStart)
throw new FormatException($"Unexpected character '{Current}' at position {_pos}.");
throw new FormatException(
$"Unexpected character '{Current}' at position {_pos}."
);
var numSpan = _input.Slice(numStart, _pos - numStart).ToString();
if (!double.TryParse(numSpan, NumberStyles.Float, CultureInfo.InvariantCulture, out var number))
if (
!double.TryParse(
numSpan,
NumberStyles.Float,
CultureInfo.InvariantCulture,
out var number
)
)
throw new FormatException($"Invalid number: '{numSpan}'");
return number;
+5 -3
View File
@@ -7,8 +7,9 @@ namespace OpenNest.Math
{
public static class Fraction
{
public static readonly Regex FractionRegex =
new Regex(@"((?<WholeNum>\d+)(\ |-))?(?<Fraction>\d+\/\d+)");
public static readonly Regex FractionRegex = new Regex(
@"((?<WholeNum>\d+)(\ |-))?(?<Fraction>\d+\/\d+)"
);
public static bool IsValid(string s)
{
@@ -59,7 +60,8 @@ namespace OpenNest.Math
{
var sb = new StringBuilder(input);
var fractionMatches = FractionRegex.Matches(sb.ToString())
var fractionMatches = FractionRegex
.Matches(sb.ToString())
.Cast<Match>()
.OrderByDescending(m => m.Index);