diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json index 473828a29..96f0becb6 100644 --- a/.config/dotnet-tools.json +++ b/.config/dotnet-tools.json @@ -3,7 +3,7 @@ "isRoot": true, "tools": { "csharpier": { - "version": "0.9.5", + "version": "0.9.6", "commands": [ "dotnet-csharpier" ] diff --git a/Src/CSharpier.Playground/Controllers/FormatController.cs b/Src/CSharpier.Playground/Controllers/FormatController.cs index ade27bce5..fedfa2242 100644 --- a/Src/CSharpier.Playground/Controllers/FormatController.cs +++ b/Src/CSharpier.Playground/Controllers/FormatController.cs @@ -103,10 +103,7 @@ private bool Exists(string filePath) public string ExecuteApplication(string pathToExe, string workingDirectory, string args) { - var processStartInfo = new ProcessStartInfo( - pathToExe, - args - ) + var processStartInfo = new ProcessStartInfo(pathToExe, args) { UseShellExecute = false, RedirectStandardError = true, diff --git a/Src/CSharpier.Tests/CommandLineFormatterTests.cs b/Src/CSharpier.Tests/CommandLineFormatterTests.cs index 343420a67..eaa722d5d 100644 --- a/Src/CSharpier.Tests/CommandLineFormatterTests.cs +++ b/Src/CSharpier.Tests/CommandLineFormatterTests.cs @@ -236,8 +236,7 @@ params string[] directoryOrFilePaths } var fakeConsole = new TestConsole(); - var result = - CommandLineFormatter.Format( + var result = CommandLineFormatter.Format( new CommandLineOptions { DirectoryOrFilePaths = directoryOrFilePaths, diff --git a/Src/CSharpier.Tests/TestFiles/BaseTest.cs b/Src/CSharpier.Tests/TestFiles/BaseTest.cs index 1c800bd8b..ac860de3b 100644 --- a/Src/CSharpier.Tests/TestFiles/BaseTest.cs +++ b/Src/CSharpier.Tests/TestFiles/BaseTest.cs @@ -31,8 +31,11 @@ protected void RunTest(string folderName, string fileName, bool useTabs = false) folderName, fileName + ".cst" ); - var fileReaderResult = - FileReader.ReadFile(filePath, new FileSystem(), CancellationToken.None).Result; + var fileReaderResult = FileReader.ReadFile( + filePath, + new FileSystem(), + CancellationToken.None + ).Result; var formatter = new CodeFormatter(); var result = formatter.Format( diff --git a/Src/CSharpier/CommandLineFormatter.cs b/Src/CSharpier/CommandLineFormatter.cs index acd4630de..6ff9e993f 100644 --- a/Src/CSharpier/CommandLineFormatter.cs +++ b/Src/CSharpier/CommandLineFormatter.cs @@ -71,8 +71,7 @@ CancellationToken cancellationToken fileSystem ); - var ignoreFile = - await IgnoreFile.Create( + var ignoreFile = await IgnoreFile.Create( baseDirectoryPath, fileSystem, console, diff --git a/Src/CSharpier/CommandLineOptions.cs b/Src/CSharpier/CommandLineOptions.cs index 607092291..43b6a8a3f 100644 --- a/Src/CSharpier/CommandLineOptions.cs +++ b/Src/CSharpier/CommandLineOptions.cs @@ -29,9 +29,7 @@ public static RootCommand Create() { var rootCommand = new RootCommand { - new Argument( - "directoryOrFile" - ) + new Argument("directoryOrFile") { Arity = ArgumentArity.ZeroOrMore, Description = "One or more paths to a directory containing files to format or a file to format. If a path is not specified the current directory is used" diff --git a/Src/CSharpier/DocTypes/Doc.cs b/Src/CSharpier/DocTypes/Doc.cs index 50983d74f..361f2c553 100644 --- a/Src/CSharpier/DocTypes/Doc.cs +++ b/Src/CSharpier/DocTypes/Doc.cs @@ -20,8 +20,10 @@ public static implicit operator Doc(string value) public static readonly HardLine HardLineIfNoPreviousLine = new(true); - public static readonly HardLine HardLineIfNoPreviousLineSkipBreakIfFirstInGroup = - new(true, true); + public static readonly HardLine HardLineIfNoPreviousLineSkipBreakIfFirstInGroup = new( + true, + true + ); public static readonly LiteralLine LiteralLine = new(); @@ -32,10 +34,12 @@ public static implicit operator Doc(string value) public static readonly Trim Trim = new(); public static LeadingComment LeadingComment(string comment, CommentType commentType) => - new() { Type = commentType, Comment = comment }; + new() + { Type = commentType, Comment = comment }; public static TrailingComment TrailingComment(string comment, CommentType commentType) => - new() { Type = commentType, Comment = comment }; + new() + { Type = commentType, Comment = comment }; public static Concat Concat(List contents) => new(contents); @@ -66,13 +70,16 @@ public static Doc Join(Doc separator, IEnumerable array) } public static ForceFlat ForceFlat(List contents) => - new() { Contents = contents.Count == 0 ? contents[0] : Concat(contents) }; + new() + { Contents = contents.Count == 0 ? contents[0] : Concat(contents) }; public static ForceFlat ForceFlat(params Doc[] contents) => - new() { Contents = contents.Length == 0 ? contents[0] : Concat(contents) }; + new() + { Contents = contents.Length == 0 ? contents[0] : Concat(contents) }; public static Group Group(List contents) => - new() { Contents = contents.Count == 1 ? contents[0] : Concat(contents) }; + new() + { Contents = contents.Count == 1 ? contents[0] : Concat(contents) }; public static Group GroupWithId(string groupId, params Doc[] contents) { @@ -82,10 +89,12 @@ public static Group GroupWithId(string groupId, params Doc[] contents) } public static Group Group(params Doc[] contents) => - new() { Contents = contents.Length == 1 ? contents[0] : Concat(contents) }; + new() + { Contents = contents.Length == 1 ? contents[0] : Concat(contents) }; public static IndentDoc Indent(params Doc[] contents) => - new() { Contents = contents.Length == 1 ? contents[0] : Concat(contents) }; + new() + { Contents = contents.Length == 1 ? contents[0] : Concat(contents) }; public static IndentDoc Indent(List contents) => new() { Contents = Concat(contents) }; @@ -95,11 +104,7 @@ public static IfBreak IfBreak( string? groupId = null ) => new() - { - FlatContents = flatContents, - BreakContents = breakContents, - GroupId = groupId, - }; + { FlatContents = flatContents, BreakContents = breakContents, GroupId = groupId, }; public static IndentIfBreak IndentIfBreak(Doc contents, string groupId) => new(contents, groupId); diff --git a/Src/CSharpier/GeneratedCodeUtilities.cs b/Src/CSharpier/GeneratedCodeUtilities.cs index 94ae69069..ab2f68120 100644 --- a/Src/CSharpier/GeneratedCodeUtilities.cs +++ b/Src/CSharpier/GeneratedCodeUtilities.cs @@ -29,8 +29,10 @@ public static bool IsGeneratedCodeFile(string filePath) || fileNameWithoutExtension.EndsWithIgnoreCase(".g.i"); } - private static readonly string[] AutoGeneratedStrings = - new[] { "( SeparatedSyntaxList list, Func printFunc, Doc afterSeparator - ) - where T : SyntaxNode { + ) where T : SyntaxNode { var docs = new List(); for (var x = 0; x < list.Count; x++) { diff --git a/Src/Worker/Ignored.cs b/Src/Worker/Ignored.cs index bf933cbed..8d6b82226 100644 --- a/Src/Worker/Ignored.cs +++ b/Src/Worker/Ignored.cs @@ -24,8 +24,7 @@ public static class Ignored public static Type[] Types = { typeof(TextSpan), typeof(SyntaxTree) }; - public static Dictionary PropertiesByType = - new() + public static Dictionary PropertiesByType = new() { { typeof(PropertyDeclarationSyntax), new[] { "semicolon" } }, { typeof(IndexerDeclarationSyntax), new[] { "semicolon" } },