csharpier
csharpier copied to clipboard
CSharpier is an opinionated code formatter for c#.
As formatted by 0.27 in playground **Input:** ```csharp var dummy = new DestructuringOptionsBuilder() .WithDefaultDestructurers() .WithDestructurers([ new FirstDestructurer(), new SecondDestructurer(), new ThirdDestructurer(), new FourthDestructurer(), ]); ``` **Output:** ```csharp var dummy =...
Context: - CSharpier is installed as a local dotnet tool in my projects that use it. - I have the VS extension installed, with Format on Save activated. - I...
**Input:** ```C# services.AddMetricsTrackingMiddleware( // Comment opts => { opts.IgnoredHttpStatusCodes = Enumerable.Range(300, 9).ToArray(); } ); ``` **Output:** ```C# services.AddMetricsTrackingMiddleware( // Comment opts => { opts.IgnoredHttpStatusCodes = Enumerable.Range(300, 9).ToArray(); }); ``` **Expected...
**Input:** ```C# new Something( formBindings: dto .Forms.Select(form => new FormBinding { Id = form.Id, Type = formBindings.First(x => x.Id == form.Id).Type, FormTypeForInitialAnswers = form.FormTypeForInitialAnswers, }) .ToList() ) { FormBindings =...
**Input:** See output. **Output:** ```cs var v = $""" abcde abcde abcde abcde abcde {string.Join( ", ", new[] { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11,...
**Input:** ```C# [AllowedExtensions( [ ".txt", ".pdf", ".doc", ".jpeg", ".jpg", ".zip", ".7z", ".png", ".xlsx", ".xlx", ".docx", ".csv" ] )] async Task PatchResults(){} ``` **Output:** ```C# [AllowedExtensions( [ ".txt", ".pdf", ".doc", ".jpeg",...
**Input:** ``` var foo = 1; var bar = 2; // csharpier-ignore var baz = 3; ``` **Output:** Inconsistent empty line handling before the `// csharpier-ignore` comment ``` var foo...
**Input:** ```cs bool excluded = false, included = false; ``` **Output:** ```cs // Formatted by 0.27 bool excluded = false, included = false; ``` **Expected behavior:** I think the CSharpier...
```c# o.Property.CallMethod( someParameter_____________________________, someParameter_____________________________ ) .CallMethod() .CallMethod(); // should be o.Property.CallMethod( someParameter_____________________________, someParameter_____________________________ ) .CallMethod() .CallMethod(); ``` But in cases like this, do keep it dedented ```c# this.Method( someParameter__________________________________, someParameter__________________________________...
closes #921 The goal of this ticket was to prefer breaking trailing members on a parenthesized expression before breaking the expression. For example. ```c# // input (someObject as SomeLongType__________________________________________).CallMethod(); //...