Description
dotnet csharpier format . leaves a double blank line after #endif, but dotnet csharpier check . flags it as unformatted -- expecting a single blank line. This makes CI checks fail on code the formatter itself produced.
Reproduction
Given this file:
using Newtonsoft.Json;
#if NET472
using System.Windows.Markup;
#endif
namespace TestLib
{
- Run
dotnet csharpier format . -- file is unchanged (double blank line stays)
- Run
dotnet csharpier check . -- reports the file as not formatted, expects single blank line
Error ./TestData.cs - Was not formatted.
----------------------------- Expected: Around Line 12 -----------------------------
namespace TestLib
{
----------------------------- Actual: Around Line 12 -----------------------------
namespace TestLib
Expected behavior
format and check should produce consistent results. Either format should remove the extra blank line, or check should not flag it.
Version
CSharpier 1.2.6
Description
dotnet csharpier format .leaves a double blank line after#endif, butdotnet csharpier check .flags it as unformatted -- expecting a single blank line. This makes CI checks fail on code the formatter itself produced.Reproduction
Given this file:
dotnet csharpier format .-- file is unchanged (double blank line stays)dotnet csharpier check .-- reports the file as not formatted, expects single blank lineExpected behavior
formatandcheckshould produce consistent results. Eitherformatshould remove the extra blank line, orcheckshould not flag it.Version
CSharpier 1.2.6