A reliability-focused follow-up to 1.3.151-beta. It fixes several crashes and broken code fixes, checks the layout of multi-line collection expressions, and reduces false positives in SA1121, SA1143 and SA1653.
Highlights
- Crash and code fix fixes. These cover a crash in SA1627/SA1651 on
<include>, crashes and an infinite loop in SA1500 and its code fix, crashes in the SA1642 and using-directive code fixes, and a using code fix that rewrote a non-genericSystem.ValueTuplealias. (#4380, #4383, #4382, #4384, #4381, #4385) - Collection expression layout. SA1500 and SA1137 now check the brackets of multi-line collection expressions. (#4396)
- Fewer false positives. SA1121 keeps
IntPtrandUIntPtrwherenintandnuintwould be wrong, SA1653 ignores generated partial declarations such as WPF*.g.csfiles, and the SA1143 fix keeps multi-line branches intact. (#4395, #4393, #4392)
Behavior changes worth knowing about
- SA1500 now checks multi-line collection expressions, and SA1137 checks the alignment of their closing bracket. Expect new warnings where a closing
]shares a line with the last element. (#4396) - SA1642 expects "interface" rather than "class" in the standard text for static constructors in interfaces, for example "Initializes static members of the … interface." (#4386)
- SA1121 no longer reports
IntPtrandUIntPtrin XML documentationcrefs, or in shared source compiled for targets wherenintisn't equivalent. (#4395) - SA1653 ignores
<summary>tags in generated partial declarations. (#4393)
All changes
Fixes
- Fix collection expression bracket layout in SA1500 and SA1137 by @AArnott in #4396
- SA1121: Preserve native integer compatibility in crefs and linked targets by @AArnott in #4395
- SA1653: Ignore summary tags in generated partial declarations by @AArnott in #4393
- Fix SA1627/SA1651 crash on with no documented member by @AArnott in #4380
- Fix SA1500 NRE on a top-level block at the start of a file by @AArnott in #4383
- Fix SA1500 code fix infinite loop on unmatched braces by @AArnott in #4382
- Fix SA1642 code fix for static constructors in generic interfaces by @AArnott in #4384
- Fix NRE in using code fix when qualifying alias-any-type usings by @AArnott in #4381
- Fix using code fix rewriting non-generic System.ValueTuple alias by @AArnott in #4385
- Use 'interface' in SA1642 standard text for interface static constructors by @AArnott in #4386
- SA1143: Preserve multiline branches when aligning closing delimiters by @AArnott in #4392
Infrastructure and build
- Update dotnet monorepo by @renovate[bot] in #4387
- Update dependency Microsoft.CodeAnalysis.Analyzers to 5.11.0-1.26521.10 by @renovate[bot] in #4347
- Update dependency Microsoft.CodeAnalysis.Analyzers to 5.11.0-1.26525.1 by @renovate[bot] in #4379
- Update actions/setup-dotnet action to v6.1.0 by @renovate[bot] in #4394
- Update dependency node to v26 by @renovate[bot] in #4389
- Update dependency dotnet-reportgenerator-globaltool to v5.5.12 by @renovate[bot] in #4388
Full Changelog: 1.3.151-beta...1.3.171-beta