csharpier
csharpier copied to clipboard
CSharpier is an opinionated code formatter for c#.
Switch expressions (as with functions) should be broken if one line is too long to maintain readability. This is an example of a switch expression return. We have the line...
**Input:** ``` var couponCampaign = await dbContext.CouponCampaigns .Where(c => c.Claims!.All(cl => cl.UserId != userId)) .Where(c => c.StartDate >= DateTimeOffset.UtcNow) .FirstOrThrowAsync(c => c.Id == couponCampaignId); ``` ``` var couponCampaign = await...
**Input:** ``` class Utils { string GetTypeName(object value) { return $@" {value.GetType().Name} text text text text text text text text text text text text"; } } ``` **Output:** ``` class...
**Environments:** - CSharpier Version: 0.29.2 - Running CSharpier via: dotnet - Operating System: Ubuntu 22.04 - .csharpierrc Settings: - .editorconfig Settings: **Steps to reproduce:** dotnet build --configuration Release /p:CSharpier_LogLevel=Error **Expected...
Support wrapping single line comment and multi-line comments based on line width. This commit fixes #1352
Single line/multi line comments are not automatically wrapped/checked by csharpier. **Input:** ```c# // Test very long line comment. // Second line of long comment. var someVariable = someValue; ``` Width...
**Input:** ``` var new User() { Name = user.name, Roles = [] // Todo set roles }; ``` **Output:** ``` var user = new User() { Name = user.name, Roles...
We have this issue in various places in our code, I reduced it to a minimal example: **Input:** With default settings in playground (print width 100, indent size 4) ```csharp...
**Environments** - IDE Version: VS Code 1.93.1 - Extension Version: 1.8.0 - CSharpier Version: 0.29.0, 0.29.1 - Operating System: Ubuntu devcontainer on both Mac and Windows - .csharpierrc Settings: N/A...