csharpier
csharpier copied to clipboard
CSharpier is an opinionated code formatter for c#.
I think the tool should remove redundant (duplicate or unused) `using` statements. Expected: ```cs using MyUsedHelper; ``` Actual: ```cs using MyUsedHelper; using MyUsedHelper; using MyUnusedHelper; ```
If in invocation contains two lambdas, it can look better to break it. ```c# app.UseWhen(c => c.Request.IsAjaxRequest(), o => o.UseMiddleware()); // vs app.UseWhen( c => c.Request.IsAjaxRequest(), o => o.UseMiddleware() );...
Been experiencing this on a work repo but I've been getting this:  on [this repro](https://github.com/HrvojeJuric/csharpier-vscode-long-repro). I have these extensions installed: ``` arcanis.vscode-zipfs bbenoist.Nix bmalehorn.shell-syntax ChakrounAnas.turbo-console-log codezombiech.gitignore charliermarsh.ruff csharpier.csharpier-vscode ctcuff.font-preview...
If you run `dotnet csharpier --write-stdout` against a file that has not changed since the last time csharpier was run, it will not return anything. This appears to be related...
The same call with or without parens ends up breaking differently. Maybe the 2nd version should be consistent with the first version, and just break before the parameter even when...
If you use Shared Projects `.shproj`, the contents are not formatted here. Although the code actually belongs to the consuming `.csproj` projects.
```cs public static class ImageSizeExtensions { public static int GetQuality(this ImageSize value) { switch (value) { // csharpier-ignore-start case ImageSize.Large: return 70; case ImageSize.Medium: return 80; case ImageSize.Small: return 85;...
### Discussed in https://github.com/belav/csharpier/discussions/942 Originally posted by **Tyrrrz** August 23, 2023 I'm not entirely sure if it doesn't work like this already, but judging by the fact that Rider told...
Hello, It would be nice if we could enforce the curly brackets for conditions and loops. Probably, a strategy for that would be better, something like: * always => always...
Tested with 0.24.2, this can be reproduced in the playground: ```csharp // Input public class C { public void Test() { this // This is a comment .LongUglyMethod(); } }...