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:
@@ -62,8 +62,10 @@ namespace OpenNest.IO.Bom
|
||||
|
||||
var lookupName = item.FileName;
|
||||
|
||||
if (lookupName.EndsWith(".dxf", StringComparison.OrdinalIgnoreCase)
|
||||
|| lookupName.EndsWith(".dwg", StringComparison.OrdinalIgnoreCase))
|
||||
if (
|
||||
lookupName.EndsWith(".dxf", StringComparison.OrdinalIgnoreCase)
|
||||
|| lookupName.EndsWith(".dwg", StringComparison.OrdinalIgnoreCase)
|
||||
)
|
||||
lookupName = Path.GetFileNameWithoutExtension(lookupName);
|
||||
|
||||
if (!folderExists)
|
||||
@@ -86,13 +88,13 @@ namespace OpenNest.IO.Bom
|
||||
.GroupBy(p => new
|
||||
{
|
||||
Material = (p.Item.Material ?? "").ToUpperInvariant(),
|
||||
Thickness = p.Item.Thickness.Value
|
||||
Thickness = p.Item.Thickness.Value,
|
||||
})
|
||||
.Select(g => new MaterialGroup
|
||||
{
|
||||
Material = g.First().Item.Material ?? "",
|
||||
Thickness = g.Key.Thickness,
|
||||
Parts = g.ToList()
|
||||
Parts = g.ToList(),
|
||||
})
|
||||
.OrderBy(g => g.Material)
|
||||
.ThenBy(g => g.Thickness)
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
using ClosedXML.Excel;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using ClosedXML.Excel;
|
||||
|
||||
namespace OpenNest.IO.Bom
|
||||
{
|
||||
@@ -20,7 +20,9 @@ namespace OpenNest.IO.Bom
|
||||
private IXLWorksheet GetPartsWorksheet()
|
||||
{
|
||||
if (!workbook.TryGetWorksheet("Parts", out var worksheet))
|
||||
throw new InvalidOperationException("BOM file does not contain a 'Parts' worksheet.");
|
||||
throw new InvalidOperationException(
|
||||
"BOM file does not contain a 'Parts' worksheet."
|
||||
);
|
||||
return worksheet;
|
||||
}
|
||||
|
||||
@@ -41,7 +43,8 @@ namespace OpenNest.IO.Bom
|
||||
for (var columnIndex = 1; columnIndex <= lastColumn; columnIndex++)
|
||||
{
|
||||
var cell = worksheet.Cell(1, columnIndex);
|
||||
if (cell.IsEmpty()) continue;
|
||||
if (cell.IsEmpty())
|
||||
continue;
|
||||
|
||||
var excelColumnName = cell.GetString().ToUpper();
|
||||
var isMatch = classColumnNames.Any(n => n == excelColumnName);
|
||||
|
||||
@@ -6,17 +6,23 @@ namespace OpenNest.IO.Bom
|
||||
{
|
||||
public static int? ToIntOrNull(this IXLCell cell)
|
||||
{
|
||||
if (cell.IsEmpty()) return null;
|
||||
if (cell.DataType == XLDataType.Number) return (int)cell.GetDouble();
|
||||
if (int.TryParse(cell.GetString(), out var i)) return i;
|
||||
if (cell.IsEmpty())
|
||||
return null;
|
||||
if (cell.DataType == XLDataType.Number)
|
||||
return (int)cell.GetDouble();
|
||||
if (int.TryParse(cell.GetString(), out var i))
|
||||
return i;
|
||||
return null;
|
||||
}
|
||||
|
||||
public static double? ToDoubleOrNull(this IXLCell cell)
|
||||
{
|
||||
if (cell.IsEmpty()) return null;
|
||||
if (cell.DataType == XLDataType.Number) return cell.GetDouble();
|
||||
if (double.TryParse(cell.GetString(), out var result)) return result;
|
||||
if (cell.IsEmpty())
|
||||
return null;
|
||||
if (cell.DataType == XLDataType.Number)
|
||||
return cell.GetDouble();
|
||||
if (double.TryParse(cell.GetString(), out var result))
|
||||
return result;
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user