diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json index ac4f591cf..b4a2ddb8d 100644 --- a/.config/dotnet-tools.json +++ b/.config/dotnet-tools.json @@ -3,7 +3,7 @@ "isRoot": true, "tools": { "csharpier": { - "version": "0.9.2", + "version": "0.9.4", "commands": [ "dotnet-csharpier" ] diff --git a/Src/CSharpier.Tests/LineEndingTests.cs b/Src/CSharpier.Tests/LineEndingTests.cs index d6641f802..d881d2733 100644 --- a/Src/CSharpier.Tests/LineEndingTests.cs +++ b/Src/CSharpier.Tests/LineEndingTests.cs @@ -60,7 +60,8 @@ public void LineEndings_In_Verbatim_String_Should_Respect_Options( string newLine, EndOfLine endOfLine ) { - var code = @$"class ClassName + var code = + @$"class ClassName {{ string value = @""one{newLine}two""; }} diff --git a/Src/CSharpier.Tests/SyntaxNodeComparerTests.cs b/Src/CSharpier.Tests/SyntaxNodeComparerTests.cs index 5560860fe..6f4fb48ca 100644 --- a/Src/CSharpier.Tests/SyntaxNodeComparerTests.cs +++ b/Src/CSharpier.Tests/SyntaxNodeComparerTests.cs @@ -31,7 +31,8 @@ namespace Namespace { } public void Class_Not_Equal_Class_Different_Whitespace() { var left = "class ClassName { }"; - var right = @"class ClassName { + var right = + @"class ClassName { }"; var result = this.AreEqual(left, right); @@ -79,7 +80,8 @@ public Resources() } } "; - var right = @"class Resources + var right = + @"class Resources { public Resources() { } } @@ -156,12 +158,14 @@ public DropdownAttribute(bool ignoreIfNotPresent) [Test] public void MissingSemiColon() { - var left = @"public enum Enum + var left = + @"public enum Enum { Integer, String, };"; - var right = @"public enum Enum + var right = + @"public enum Enum { Integer, String, diff --git a/Src/CSharpier/CSharpier.csproj b/Src/CSharpier/CSharpier.csproj index 7c6bd2c50..e33affb6a 100644 --- a/Src/CSharpier/CSharpier.csproj +++ b/Src/CSharpier/CSharpier.csproj @@ -1,5 +1,5 @@ - + Exe CSharpier @@ -15,6 +15,7 @@ + diff --git a/Src/CSharpier/DocPrinter/PropagateBreaks.cs b/Src/CSharpier/DocPrinter/PropagateBreaks.cs index 468394c02..22d96c381 100644 --- a/Src/CSharpier/DocPrinter/PropagateBreaks.cs +++ b/Src/CSharpier/DocPrinter/PropagateBreaks.cs @@ -34,7 +34,7 @@ bool OnEnter(Doc doc) if ( doc is IBreakParent && (forceFlat == 0 || (forceFlat > 0 && doc is LiteralLine)) ) { - if (doc is HardLine { SkipBreakIfFirstInGroup: true } && canSkipBreak) + if (doc is HardLine { SkipBreakIfFirstInGroup: true } && canSkipBreak) { if (groupStack.Count > 1) { @@ -59,7 +59,7 @@ bool OnEnter(Doc doc) alreadyVisitedSet.Add(group); } - else if (doc is StringDoc { IsDirective: false } ) + else if (doc is StringDoc { IsDirective: false }) { canSkipBreak = false; } diff --git a/Src/CSharpier/Program.cs b/Src/CSharpier/Program.cs index d3048badd..3f2b25838 100644 --- a/Src/CSharpier/Program.cs +++ b/Src/CSharpier/Program.cs @@ -33,7 +33,7 @@ public static async Task Run( bool skipWrite, CancellationToken cancellationToken ) { - if (directoryOrFile is null or { Length: 0 } ) + if (directoryOrFile is null or { Length: 0 }) { directoryOrFile = new[] { Directory.GetCurrentDirectory() }; } diff --git a/Src/CSharpier/SyntaxPrinter/Token.cs b/Src/CSharpier/SyntaxPrinter/Token.cs index f722ffa3d..6a597fe87 100644 --- a/Src/CSharpier/SyntaxPrinter/Token.cs +++ b/Src/CSharpier/SyntaxPrinter/Token.cs @@ -62,7 +62,7 @@ private static Doc PrintSyntaxToken( && syntaxToken.Text.StartsWith("@")) || (syntaxToken.Kind() == SyntaxKind.InterpolatedStringTextToken && syntaxToken.Parent!.Parent - is InterpolatedStringExpressionSyntax { StringStartToken: { RawKind: (int)SyntaxKind.InterpolatedVerbatimStringStartToken } } ) + is InterpolatedStringExpressionSyntax { StringStartToken: { RawKind: (int)SyntaxKind.InterpolatedVerbatimStringStartToken } }) ) { var lines = syntaxToken.Text.Replace("\r", string.Empty).Split(new[] { '\n' }); docs.Add(Doc.Join(Doc.LiteralLine, lines.Select(o => new StringDoc(o))));