TNG / ArchUnitNET

A C# architecture test library to specify and assert architecture rules in C# for automated testing.
Apache License 2.0
915 stars 60 forks source link

chore(deps): update dependency csharpier to 0.29.2 - autoclosed #285

Closed renovate[bot] closed 1 month ago

renovate[bot] commented 2 months ago

This PR contains the following updates:

Package Change Age Adoption Passing Confidence
csharpier 0.28.2 -> 0.29.2 age adoption passing confidence

Release Notes

belav/csharpier (csharpier) ### [`v0.29.2`](https://redirect.github.com/belav/csharpier/releases/tag/0.29.2) [Compare Source](https://redirect.github.com/belav/csharpier/compare/0.29.1...0.29.2) #### What's Changed ##### Comments don't follow tabs indent style [#​1343](https://redirect.github.com/belav/csharpier/issues/1343) Prior to `0.29.2` CSharpier was converting any tabs within the block of a multiline comment to spaces. ```c# public void SomeFunction() { /* The following line is an example with an indent: This line is indented by one tab. (prior to 0.29.2 this would end up as a tab followed by 4 spaces) */ /* The following line is an example with an indent: This line is indented by 4 spaces but will be converted to 1 tab (prior to 0.29.2 this would end up as a tab followed by 4 spaces) */ /* The following line is an example with an indent: This line is indented by 3 spaces but will be left as 3 spaces */ } ``` ##### `csharpier-ignore-start` now supported in object initializers [#​1342](https://redirect.github.com/belav/csharpier/issues/1342) ```c# // input & expected output return new SomeClass { // csharpier-ignore-start SomeProperty = someValue, SomeProperty2 = someValue // csharpier-ignore-end }; // 0.29.1 return new SomeClass { // csharpier-ignore-start SomeProperty = someValue, SomeProperty2 = someValue // csharpier-ignore-end }; ``` ##### Fixed extra new line between cast and collection expression. [#​1334](https://redirect.github.com/belav/csharpier/issues/1334) ```c# // input & expected output CallMethod( (string[]) [ longerValue_____________________________________________, longerValue_____________________________________________, ] ); // 0.29.1 CallMethod( (string[]) [ longerValue_____________________________________________, longerValue_____________________________________________, ] ); ``` ##### Support custom extensions in .editorconfig [#​1273](https://redirect.github.com/belav/csharpier/issues/1273) As of `0.29.0` CSharpier could format non-standard file extensions, but only if configured in the `csharpierrc` file. This is now supported with an `.editorconfig` ```ini [*.cst] csharpier_formatter = csharp indent_style = space indent_size = 2 max_line_length = 80 ``` **Full Changelog**: https://github.com/belav/csharpier/compare/0.29.1...0.29.2 ### [`v0.29.1`](https://redirect.github.com/belav/csharpier/releases/tag/0.29.1) [Compare Source](https://redirect.github.com/belav/csharpier/compare/0.29.0...0.29.1) #### What's Changed ##### Sorting of usings with underscore differs from Visual Studio [#​1327](https://redirect.github.com/belav/csharpier/issues/1327) CSharpier now sorts `_` to the bottom of usings. ```c# using SomeCompany.MWord; using SomeCompany.ZWord; using SomeCompany._Word; ``` ##### Process cannot access the file "....net8.0\any\server.log" while running multiple extensions. [#​1324](https://redirect.github.com/belav/csharpier/issues/1324) CSharpier Server now uses a log file name based on the port that it is starting on to avoid concurrency issues trying to access the same log file **Full Changelog**: https://github.com/belav/csharpier/compare/0.29.0...0.29.1 ### [`v0.29.0`](https://redirect.github.com/belav/csharpier/blob/HEAD/CHANGELOG.md#0290) [Compare Source](https://redirect.github.com/belav/csharpier/compare/0.28.2...0.29.0) #### Breaking Changes ##### The formatting command will now exit with an error code of 1 if one of the target files cannot be compiled [#​1131](https://redirect.github.com/belav/csharpier/issues/1131) Prior to 0.29.0 if csharpier encountered a file that could not be compiled it would treat it as a warning and exit with a code of 0.\ As of 0.29.0 a file that cannot be compiled is now treated as an error and csharpier will exit with code 1 #### What's Changed ##### Enforce trailing commas in object and collection initializer [#​668](https://redirect.github.com/belav/csharpier/issues/668) CSharpier will now add trailing commas automatically where appropriate. It will collapse to a single line and remove the trailing comma in cases where everything fits on one line. ```c# // input public enum SomeEnum { Value1, Value2 } string[] someArray = new string[] { someLongValue_____________________________________________, someLongValue_____________________________________________ }; string[] someArray = new string[] { someValue, someValue, }; // 0.29.0 public enum SomeEnum { Value1, Value2, } string[] someArray = new string[] { someLongValue_____________________________________________, someLongValue_____________________________________________, } string[] someArray = new string[] { someValue, someValue }; ``` Many thanks go to [@​dawust](https://redirect.github.com/dawust) for the contribution. ##### Support for formatting custom file extensions [#​1220](https://redirect.github.com/belav/csharpier/issues/1220) Prior to 0.29.0 csharpier would only format files with an extension of .cs or .csx. It is now possible to configure csharpier to format other files extensions, and to specify configuration options per file extension. See https://csharpier.com/docs/Configuration#configuration-overrides for more details. ##### Invalid blank line being added with lambda returning collection expression [#​1306](https://redirect.github.com/belav/csharpier/issues/1306) ```c# // input & expected output CallMethod(_ => [ LongValue________________________________________________, LongValue________________________________________________, ] ); // 0.28.2 CallMethod(_ => [ LongValue________________________________________________, LongValue________________________________________________, ] ); ``` ##### Switch expressions do not break consistently with other lambdas [#​1282](https://redirect.github.com/belav/csharpier/issues/1282) Prior to 0.29.0 csharpier would break before the `=>` in switch expression arms. It now breaks after them to be consistent with other lambda expressions. ```c# // 0.28.2 return someEnum switch { Value1 => someOtherValue, Value2 or Value3 => someValue________________________________________________________________________, Value4 => someValue_____________________________________________________________________________, }; // 0.29.0 return someEnum switch { Value1 => someOtherValue, Value2 or Value3 => someValue________________________________________________________________________, Value4 => someValue_____________________________________________________________________________, }; ``` ##### Formatting of empty collection initializer for huge type [#​1268](https://redirect.github.com/belav/csharpier/issues/1268) Empty collection expression initializers formatting was including a break plus indentation resulting in poor formatting. ```c# // 0.28.2 var someObject = new List<( int Field1__________________________________, int Field2__________________________________ )> { }; // 0.29.0 var someObject = new List<( int Field1__________________________________, int Field2__________________________________ )> { }; ``` Thanks go to [@​Rudomitori](https://redirect.github.com/Rudomitori) for the contribution ##### Switch expression single line broken when preceded by comment [#​1262](https://redirect.github.com/belav/csharpier/issues/1262) Improved formatting for short expression arms that have a leading comment. ```c# // 0.28.2 return someValue switch { // comment Some.One => 1, Some.Two => 2, }; return someValue switch { Some.One => 1, // comment Some.Two => 2, }; // 0.29.0 return someValue switch { // comment Some.One => 1, Some.Two => 2, }; return someValue switch { Some.One => 1, // comment Some.Two => 2, }; ``` ##### Incorrect formatting of ternary expression with a comment after an interpolated string [#​1258](https://redirect.github.com/belav/csharpier/issues/1258) Fixed bug with comments on a ternary expression that resulted in invalid code. ```c# // input & expected output public string TrailingComment = someCondition ? $"empty" // trailing comment : someString; // 0.28.2 public string TrailingComment = someCondition ? $"empty" // trailing comment : someString; ``` ##### Formatting for indexer parameters should mostly be the same as for method parameters. [#​1255](https://redirect.github.com/belav/csharpier/issues/1255) Improved formatting of indexed properties that contained attributes. ```c# // input & expected output public class ClassName { public string this[ [SomeAttribute] int a________________________________, [SomeAttribute] int b________________________________ ] => someValue; } // 0.28.2 public class ClassName { public string this[[SomeAttribute] int a________________________________, [SomeAttribute] int b________________________________] => someValue; } ``` ##### Do not overwrite `CSharpier_Check` when already set. [#​1314](https://redirect.github.com/belav/csharpier/pull/1314) Fixed a bug with csharpier.msbuild where it would overwrite the `CSharpier_Check` value in some cases. Thanks go to [@​PetSerAl](https://redirect.github.com/PetSerAl) for the contribution ##### The CLI has contradictory message about directoryOrFile being required [#​1296](https://redirect.github.com/belav/csharpier/issues/1296) The help text for the cli has been improved to better indicate when `directoryOrFile` is required. Thanks go to [@​marcinjahn](https://redirect.github.com/marcinjahn) for the contribution ##### Fullwidth unicode characters should be accounted for in print width [#​260](https://redirect.github.com/belav/csharpier/issues/260) CSharpier now considers full width unicode characters such as `가` to be 2 spaces wide when determining how to format code. **Full Changelog**: https://github.com/belav/csharpier/compare/0.28.2...0.29.0

Configuration

📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

Rebasing: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.



This PR was generated by Mend Renovate. View the repository job log.

codecov-commenter commented 2 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 65.41%. Comparing base (1bfa1e6) to head (605b285).

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #285 +/- ## ======================================= Coverage 65.41% 65.41% ======================================= Files 254 254 Lines 22853 22853 Branches 1938 1938 ======================================= Hits 14949 14949 Misses 7360 7360 Partials 544 544 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.