Repository navigation
Support C# 15 unions in SA1600/SA1601/SA1300/SA1400/SA1206/SA1201-SA1204 (test with Roslyn 5.10 preview) - #4191
Conversation
…backs Roslyn 5.9.0 runs syntax node actions on a union declaration twice and on every node inside a union body three times (dotnet/roslyn#84570), so analyzers that look at unions report duplicate diagnostics. dotnet/roslyn#84604 fixed the analyzer driver in 5.10. Until Microsoft.CodeAnalysis 5.10.0 ships on nuget.org, the C# 15 test project references 5.10.0-1.26477.9 from the dotnet-tools feed, which NuGet.config already lists. Product code still builds against Roslyn 1.2.1.
… ordering rules These rules were held back in #4182 because Roslyn 5.9 reported every union diagnostic two or three times: - SA1600 and SA1601 report undocumented unions (partial unions follow the partial type policy: every part needs documentation). - SA1300 reports union names that begin with a lower-case letter. - SA1400 reports unions without an access modifier, and its code fix adds internal or private. - SA1206 checks modifier order on unions, and its code fix reorders them. - SA1201, SA1202, SA1203 and SA1204 order the members inside a union body. Each rule only registers its existing callback for SyntaxKindEx.UnionDeclaration, so there is no extra cost for code without unions. The new C# 15 tests expect each diagnostic exactly once, including the SA1003, SA1101, SA1121, SA1407, SA1600 and SA1615 diagnostics that Roslyn 5.9 reported three times on union members. They pass with the Roslyn 5.10 preview and fail with 5.9.0. The tests pass LanguageVersion.Preview explicitly because LanguageVersion has no CSharp15 value yet, so the C# 15 test project otherwise defaults to C# 14.
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #4191 +/- ##
==========================================
+ Coverage 97.51% 97.53% +0.01%
==========================================
Files 1239 1249 +10
Lines 132797 133414 +617
Branches 4288 4290 +2
==========================================
+ Hits 129502 130120 +618
+ Misses 2154 2153 -1
Partials 1141 1141 🚀 New features to boost your workflow:
|
|
I took the route of adding the needed reference types instead to not get compiler errors, in case you'd like to do the same: |
|
A Claude comparison with my fork: C# 15 union test coverage: NewStyleCopAnalyzers fork vs. this repoCompared trees:
Method: I scanned
1. Highest priority: the fork changed the analyzer itself for unionsThe fork's analyzers reference
Analyzers that reference unions in both repos: 2. Union rows the fork adds to shared C# 6 test dataOurs has no
(The fork's SA1205 shared change adds Missing here: SA1618–SA1622 (generic union type-parameter docs), SA1214, SA1506, SA1514, SA1200 and SA1207, plus the 3. Rules with union tests in the fork's C# 15 project and none hereI flagged the tests that exercise union-specific syntax (the case-type list Union-specific syntax (worth porting first)
Construct inside a union body (smoke tests)
4. Rules both repos test, where the fork covers cases this repo doesn't
5. Only in this repo (for completeness)
Notes for porting
|
A union declaration is a TypeDeclarationSyntax, so it now appears in SyntaxKinds.BaseTypeDeclaration and SyntaxKinds.TypeDeclaration, the same way records do. Every rule that registers for those lists now also analyzes unions: - Layout: SA1500, SA1502, SA1505, SA1508, SA1516 - Readability (the union's case type list): SA1106, SA1110, SA1111, SA1112, SA1113, SA1114, SA1115, SA1116, SA1117, SA1137 - Ordering: SA1205 - Documentation: SA1604, SA1605, SA1606, SA1607, SA1608, SA1611, SA1612, SA1613, SA1614, SA1616, SA1618, SA1619, SA1620, SA1621, SA1622, SA1625, SA1629 The separate union registrations that #4191 added to SA1201, SA1202, SA1203, SA1400, SA1600 and SA1601 are removed, because the shared lists now cover them (keeping them would run those rules twice per union). Rules with their own lists of type declaration kinds now include unions too: SA1207, SA1214, SA1506, SA1514 and SA1648, plus the type kind checks in SA1137 (attribute lists of nested types) and SA1200 (a union in the global namespace suppresses the rule, like other types). SA1611 skips unions: the parameter list of a union declares its case types, which have no names to document. The SA1205 and SA1502 code fixes handle unions. All of these are syntax kind registrations, so code without unions does no extra work. The new C# 15 tests expect exactly one diagnostic per violation, with code fix tests where the rule has a fix. Closes #4182
A union declaration is a TypeDeclarationSyntax, so it now appears in SyntaxKinds.BaseTypeDeclaration and SyntaxKinds.TypeDeclaration, the same way records do. Every rule that registers for those lists now also analyzes unions: - Layout: SA1500, SA1502, SA1505, SA1508, SA1516 - Readability (the union's case type list): SA1106, SA1110, SA1111, SA1112, SA1113, SA1114, SA1115, SA1116, SA1117, SA1137 - Ordering: SA1205 - Documentation: SA1604, SA1605, SA1606, SA1607, SA1608, SA1611, SA1612, SA1613, SA1614, SA1616, SA1618, SA1619, SA1620, SA1621, SA1622, SA1625, SA1629 The separate union registrations that #4191 added to SA1201, SA1202, SA1203, SA1400, SA1600 and SA1601 are removed, because the shared lists now cover them (keeping them would run those rules twice per union). Rules with their own lists of type declaration kinds now include unions too: SA1207, SA1214, SA1506, SA1514 and SA1648, plus the type kind checks in SA1137 (attribute lists of nested types) and SA1200 (a union in the global namespace suppresses the rule, like other types). SA1611 skips unions: the parameter list of a union declares its case types, which have no names to document. The SA1205 and SA1502 code fixes handle unions. All of these are syntax kind registrations, so code without unions does no extra work. The new C# 15 tests expect exactly one diagnostic per violation, with code fix tests where the rule has a fix. Closes #4182
Updated
[Meziantou.Analyzer](https://github.com/meziantou/Meziantou.Analyzer)
from 3.0.192 to 3.0.341.
<details>
<summary>Release notes</summary>
_Sourced from [Meziantou.Analyzer's
releases](https://github.com/meziantou/Meziantou.Analyzer/releases)._
## 3.0.341
NuGet package:
<https://www.nuget.org/packages/Meziantou.Analyzer/3.0.341>
## What's Changed
* MA0036: do not report classes used in a using alias directive by
@meziantou in https://github.com/meziantou/Meziantou.Analyzer/pull/1822
**Full Changelog**:
https://github.com/meziantou/Meziantou.Analyzer/compare/3.0.340...3.0.341
## 3.0.340
NuGet package:
<https://www.nuget.org/packages/Meziantou.Analyzer/3.0.340>
## What's Changed
* MA0182: remove the using directives that reference the removed type by
@meziantou in https://github.com/meziantou/Meziantou.Analyzer/pull/1817
* MA0038, MA0041: do not report members that use the extension
parameter, nor partial properties by @meziantou in
https://github.com/meziantou/Meziantou.Analyzer/pull/1819
* MA0190: produce valid code for calls used as statements, method groups
and crefs by @meziantou in
https://github.com/meziantou/Meziantou.Analyzer/pull/1818
**Full Changelog**:
https://github.com/meziantou/Meziantou.Analyzer/compare/3.0.339...3.0.340
## 3.0.339
NuGet package:
<https://www.nuget.org/packages/Meziantou.Analyzer/3.0.339>
## What's Changed
* MA0028, MA0106, MA0124, MA0151, MA0192: do not overflow the stack on
expressions with many operands by @meziantou in
https://github.com/meziantou/Meziantou.Analyzer/pull/1808
* MA0079: do not report a ConfiguredCancelableAsyncEnumerable created
elsewhere by @meziantou in
https://github.com/meziantou/Meziantou.Analyzer/pull/1800
* MA0028: do not report the string argument of
StringBuilder.Append(string, int, int) by @meziantou in
https://github.com/meziantou/Meziantou.Analyzer/pull/1796
* MA0169: do not report comparisons with this by @meziantou in
https://github.com/meziantou/Meziantou.Analyzer/pull/1784
* MA0004: do not offer a no-op fix for await using with several
declarators by @meziantou in
https://github.com/meziantou/Meziantou.Analyzer/pull/1807
* MA0040: only look up the values that can provide a token instead of
every name in scope by @meziantou in
https://github.com/meziantou/Meziantou.Analyzer/pull/1809
**Full Changelog**:
https://github.com/meziantou/Meziantou.Analyzer/compare/3.0.338...3.0.339
## 3.0.338
NuGet package:
<https://www.nuget.org/packages/Meziantou.Analyzer/3.0.338>
## What's Changed
* MA0024: report Comparer<string>.Default by @meziantou in
https://github.com/meziantou/Meziantou.Analyzer/pull/1794
* MA0017: keep the comments of the constructor when making it protected
by @meziantou in
https://github.com/meziantou/Meziantou.Analyzer/pull/1799
**Full Changelog**:
https://github.com/meziantou/Meziantou.Analyzer/compare/3.0.337...3.0.338
## 3.0.337
NuGet package:
<https://www.nuget.org/packages/Meziantou.Analyzer/3.0.337>
## What's Changed
* MA0095: call the explicit IEquatable<T>.Equals implementation when
overriding Equals(object) by @meziantou in
https://github.com/meziantou/Meziantou.Analyzer/pull/1795
**Full Changelog**:
https://github.com/meziantou/Meziantou.Analyzer/compare/3.0.336...3.0.337
## 3.0.336
NuGet package:
<https://www.nuget.org/packages/Meziantou.Analyzer/3.0.336>
## What's Changed
* MA0004: stop the reachability check at the common ancestor statement
by @meziantou in
https://github.com/meziantou/Meziantou.Analyzer/pull/1791
**Full Changelog**:
https://github.com/meziantou/Meziantou.Analyzer/compare/3.0.335...3.0.336
## 3.0.335
NuGet package:
<https://www.nuget.org/packages/Meziantou.Analyzer/3.0.335>
## What's Changed
* MA0061: treat the default value of a type parameter as the default
value of the type argument by @meziantou in
https://github.com/meziantou/Meziantou.Analyzer/pull/1790
**Full Changelog**:
https://github.com/meziantou/Meziantou.Analyzer/compare/3.0.334...3.0.335
## 3.0.334
NuGet package:
<https://www.nuget.org/packages/Meziantou.Analyzer/3.0.334>
## What's Changed
* MA0158: allocate the symbol dictionary lazily and register fewer
actions per operation block by @meziantou in
https://github.com/meziantou/Meziantou.Analyzer/pull/1798
* MA0190, MA0110: do not suggest a partial property when
GeneratedRegexAttribute cannot be applied to properties by @meziantou
in https://github.com/meziantou/Meziantou.Analyzer/pull/1801
* MA0004: do not move local functions when fixing await using
declarations by @meziantou in
https://github.com/meziantou/Meziantou.Analyzer/pull/1803
**Full Changelog**:
https://github.com/meziantou/Meziantou.Analyzer/compare/3.0.333...3.0.334
## 3.0.333
NuGet package:
<https://www.nuget.org/packages/Meziantou.Analyzer/3.0.333>
## What's Changed
* MA0036, MA0038, MA0041, MA0053: add the CompilationEnd tag to the
descriptors by @meziantou in
https://github.com/meziantou/Meziantou.Analyzer/pull/1793
* MA0182: track internal type arguments of public base types and
interfaces by @meziantou in
https://github.com/meziantou/Meziantou.Analyzer/pull/1792
**Full Changelog**:
https://github.com/meziantou/Meziantou.Analyzer/compare/3.0.332...3.0.333
## 3.0.332
NuGet package:
<https://www.nuget.org/packages/Meziantou.Analyzer/3.0.332>
## What's Changed
* MA0004: fix await foreach with a deconstruction by @meziantou in
https://github.com/meziantou/Meziantou.Analyzer/pull/1797
**Full Changelog**:
https://github.com/meziantou/Meziantou.Analyzer/compare/3.0.331...3.0.332
## 3.0.331
NuGet package:
<https://www.nuget.org/packages/Meziantou.Analyzer/3.0.331>
## What's Changed
* MA0002: find the key type of Enumerable methods from their comparer
overload by @meziantou in
https://github.com/meziantou/Meziantou.Analyzer/pull/1787
* MA0020, MA0030, MA0031, MA0063, MA0098: fix the code fixes of the
static invocation form of LINQ methods by @meziantou in
https://github.com/meziantou/Meziantou.Analyzer/pull/1788
**Full Changelog**:
https://github.com/meziantou/Meziantou.Analyzer/compare/3.0.330...3.0.331
## 3.0.330
NuGet package:
<https://www.nuget.org/packages/Meziantou.Analyzer/3.0.330>
## What's Changed
* MA0004: only count ConfigureAwait(false) as a previous ConfigureAwait
by @meziantou in
https://github.com/meziantou/Meziantou.Analyzer/pull/1786
* MA0076: do not report interpolated strings converted to IFormattable
by @meziantou in
https://github.com/meziantou/Meziantou.Analyzer/pull/1783
**Full Changelog**:
https://github.com/meziantou/Meziantou.Analyzer/compare/3.0.329...3.0.330
## 3.0.329
NuGet package:
<https://www.nuget.org/packages/Meziantou.Analyzer/3.0.329>
## What's Changed
* Tests: compile with MetadataImportOptions.Public like the command line
compiler by @meziantou in
https://github.com/meziantou/Meziantou.Analyzer/pull/1810
* MA0102: run the data flow analysis once per member by @meziantou in
https://github.com/meziantou/Meziantou.Analyzer/pull/1802
**Full Changelog**:
https://github.com/meziantou/Meziantou.Analyzer/compare/3.0.328...3.0.329
## 3.0.328
NuGet package:
<https://www.nuget.org/packages/Meziantou.Analyzer/3.0.328>
## What's Changed
* MA0060: report ignored results awaited through ConfigureAwait by
@meziantou in https://github.com/meziantou/Meziantou.Analyzer/pull/1804
* MA0050: use the method identifier to name the local function of an
explicit interface implementation by @meziantou in
https://github.com/meziantou/Meziantou.Analyzer/pull/1805
* MA0042: skip the MA0045 analysis when MA0045 is disabled by
@meziantou in https://github.com/meziantou/Meziantou.Analyzer/pull/1806
**Full Changelog**:
https://github.com/meziantou/Meziantou.Analyzer/compare/3.0.327...3.0.328
## 3.0.327
NuGet package:
<https://www.nuget.org/packages/Meziantou.Analyzer/3.0.327>
## What's Changed
* MA0182: do not remove the containing type when fixing a nested enum or
delegate by @meziantou in
https://github.com/meziantou/Meziantou.Analyzer/pull/1785
* chore(deps): update all dependencies by @renovate[bot] in
https://github.com/meziantou/Meziantou.Analyzer/pull/1772
**Full Changelog**:
https://github.com/meziantou/Meziantou.Analyzer/compare/3.0.326...3.0.327
## 3.0.326
NuGet package:
<https://www.nuget.org/packages/Meziantou.Analyzer/3.0.326>
## What's Changed
* MA0124: replace the reflection on SymbolEqualityComparer with the
public API by @meziantou in
https://github.com/meziantou/Meziantou.Analyzer/pull/1781
**Full Changelog**:
https://github.com/meziantou/Meziantou.Analyzer/compare/3.0.325...3.0.326
## 3.0.325
NuGet package:
<https://www.nuget.org/packages/Meziantou.Analyzer/3.0.325>
## What's Changed
* MA0002: Do not report empty collection expressions of frozen and
read-only collections by @meziantou in
https://github.com/meziantou/Meziantou.Analyzer/pull/1780
**Full Changelog**:
https://github.com/meziantou/Meziantou.Analyzer/compare/3.0.324...3.0.325
## 3.0.324
NuGet package:
<https://www.nuget.org/packages/Meziantou.Analyzer/3.0.324>
## What's Changed
* Drop support for Roslyn 4.x, keep Roslyn 5.0+ by @meziantou in
https://github.com/meziantou/Meziantou.Analyzer/pull/1778
**Full Changelog**:
https://github.com/meziantou/Meziantou.Analyzer/compare/3.0.323...3.0.324
## 3.0.323
NuGet package:
<https://www.nuget.org/packages/Meziantou.Analyzer/3.0.323>
## What's Changed
* Update to .NET 11 and Meziantou.NET.Sdk 1.0.199 by @meziantou in
https://github.com/meziantou/Meziantou.Analyzer/pull/1777
**Full Changelog**:
https://github.com/meziantou/Meziantou.Analyzer/compare/3.0.322...3.0.323
## 3.0.322
NuGet package:
<https://www.nuget.org/packages/Meziantou.Analyzer/3.0.322>
## What's Changed
* Fuzz: report the compiler bugs to a GitHub project instead of blaming
the analyzers by @meziantou in
https://github.com/meziantou/Meziantou.Analyzer/pull/1776
**Full Changelog**:
https://github.com/meziantou/Meziantou.Analyzer/compare/3.0.321...3.0.322
## 3.0.321
NuGet package:
<https://www.nuget.org/packages/Meziantou.Analyzer/3.0.321>
## What's Changed
* chore(deps): update dependency meziantou.framework.roslyn to 1.2.3 by
@renovate[bot] in
https://github.com/meziantou/Meziantou.Analyzer/pull/1773
* chore(deps): update dependency meziantou.framework.roslyn to 1.2.4 by
@renovate[bot] in
https://github.com/meziantou/Meziantou.Analyzer/pull/1774
**Full Changelog**:
https://github.com/meziantou/Meziantou.Analyzer/compare/3.0.320...3.0.321
## 3.0.320
NuGet package:
<https://www.nuget.org/packages/Meziantou.Analyzer/3.0.320>
## What's Changed
* Fuzz: do not report findings that only happen in a long-running
libFuzzer worker by @meziantou in
https://github.com/meziantou/Meziantou.Analyzer/pull/1771
* chore(deps): update all dependencies by @renovate[bot] in
https://github.com/meziantou/Meziantou.Analyzer/pull/1639
**Full Changelog**:
https://github.com/meziantou/Meziantou.Analyzer/compare/3.0.319...3.0.320
## 3.0.319
NuGet package:
<https://www.nuget.org/packages/Meziantou.Analyzer/3.0.319>
## What's Changed
* MA0019: Do not report EventArgs used as an attribute by @meziantou in
https://github.com/meziantou/Meziantou.Analyzer/pull/1770
**Full Changelog**:
https://github.com/meziantou/Meziantou.Analyzer/compare/3.0.318...3.0.319
## 3.0.318
NuGet package:
<https://www.nuget.org/packages/Meziantou.Analyzer/3.0.318>
## What's Changed
* MA0244, MA0245: Report the conversions of floating-point values to
decimal by @meziantou in
https://github.com/meziantou/Meziantou.Analyzer/pull/1747
**Full Changelog**:
https://github.com/meziantou/Meziantou.Analyzer/compare/3.0.317...3.0.318
## 3.0.317
NuGet package:
<https://www.nuget.org/packages/Meziantou.Analyzer/3.0.317>
## What's Changed
* Do not register code fixes that do not change the code (MA0146,
MA0177, MA0204) by @meziantou in
https://github.com/meziantou/Meziantou.Analyzer/pull/1744
**Full Changelog**:
https://github.com/meziantou/Meziantou.Analyzer/compare/3.0.316...3.0.317
## 3.0.316
NuGet package:
<https://www.nuget.org/packages/Meziantou.Analyzer/3.0.316>
## What's Changed
* chore(deps): update dependency meziantou.framework.roslyn to 1.2.2 by
@renovate[bot] in
https://github.com/meziantou/Meziantou.Analyzer/pull/1740
**Full Changelog**:
https://github.com/meziantou/Meziantou.Analyzer/compare/3.0.315...3.0.316
## 3.0.315
NuGet package:
<https://www.nuget.org/packages/Meziantou.Analyzer/3.0.315>
## What's Changed
* Use two generations in BoundedCache instead of sorting the entries by
last usage by @meziantou in
https://github.com/meziantou/Meziantou.Analyzer/pull/1739
**Full Changelog**:
https://github.com/meziantou/Meziantou.Analyzer/compare/3.0.314...3.0.315
## 3.0.314
NuGet package:
<https://www.nuget.org/packages/Meziantou.Analyzer/3.0.314>
## What's Changed
* MA0011: find the overload before computing the culture sensitivity by
@meziantou in https://github.com/meziantou/Meziantou.Analyzer/pull/1738
**Full Changelog**:
https://github.com/meziantou/Meziantou.Analyzer/compare/3.0.313...3.0.314
## 3.0.313
NuGet package:
<https://www.nuget.org/packages/Meziantou.Analyzer/3.0.313>
## What's Changed
* Fix the CA5394 build error in BoundedCacheTests by @meziantou in
https://github.com/meziantou/Meziantou.Analyzer/pull/1735
* MA0243: Use an escape sequence for invisible characters by @meziantou
in https://github.com/meziantou/Meziantou.Analyzer/pull/1737
**Full Changelog**:
https://github.com/meziantou/Meziantou.Analyzer/compare/3.0.312...3.0.313
## 3.0.312
NuGet package:
<https://www.nuget.org/packages/Meziantou.Analyzer/3.0.312>
## What's Changed
* Read the usage of the cache entries once before sorting them for the
eviction by @meziantou in
https://github.com/meziantou/Meziantou.Analyzer/pull/1734
**Full Changelog**:
https://github.com/meziantou/Meziantou.Analyzer/compare/3.0.311...3.0.312
## 3.0.311
NuGet package:
<https://www.nuget.org/packages/Meziantou.Analyzer/3.0.311>
## What's Changed
* Fuzz: remove the Moq, MSTest, Newtonsoft.Json, NUnit and Serilog
package references by @meziantou in
https://github.com/meziantou/Meziantou.Analyzer/pull/1712
* Fuzz: report a regression only when the fuzzed commit contains the fix
by @meziantou in
https://github.com/meziantou/Meziantou.Analyzer/pull/1733
* MA0110: track the node to fix when the regex is in an attribute of the
type by @meziantou in
https://github.com/meziantou/Meziantou.Analyzer/pull/1731
**Full Changelog**:
https://github.com/meziantou/Meziantou.Analyzer/compare/3.0.310...3.0.311
## 3.0.310
NuGet package:
<https://www.nuget.org/packages/Meziantou.Analyzer/3.0.310>
## What's Changed
* MA0190: find the method declaration after updating the call sites by
@meziantou in https://github.com/meziantou/Meziantou.Analyzer/pull/1708
* MA0011: do not bind the invocations of attribute arguments
speculatively by @meziantou in
https://github.com/meziantou/Meziantou.Analyzer/pull/1709
* Fuzz: do not blame the rules for the inputs on which Roslyn fails by
@meziantou in https://github.com/meziantou/Meziantou.Analyzer/pull/1710
* MA0010: do not offer the code fix when the class has no name by
@meziantou in https://github.com/meziantou/Meziantou.Analyzer/pull/1700
**Full Changelog**:
https://github.com/meziantou/Meziantou.Analyzer/compare/3.0.309...3.0.310
## 3.0.309
NuGet package:
<https://www.nuget.org/packages/Meziantou.Analyzer/3.0.309>
## What's Changed
* MA0110: keep the variable when it cannot be removed or renamed by
@meziantou in https://github.com/meziantou/Meziantou.Analyzer/pull/1698
* MA0071: do not move the attributes of the else block by @meziantou in
https://github.com/meziantou/Meziantou.Analyzer/pull/1699
* MA0077: do not throw when Equals(T) is declared several times by
@meziantou in https://github.com/meziantou/Meziantou.Analyzer/pull/1701
* MA0187: do not offer the code fix when the property has no name by
@meziantou in https://github.com/meziantou/Meziantou.Analyzer/pull/1702
* MA0102: do not offer the code fix when the diagnostic is not on a
member by @meziantou in
https://github.com/meziantou/Meziantou.Analyzer/pull/1703
* MA0117: do not offer the code fix when the property has no name by
@meziantou in https://github.com/meziantou/Meziantou.Analyzer/pull/1704
* MA0189: do not offer the code fix when the fixed buffer has no name or
type by @meziantou in
https://github.com/meziantou/Meziantou.Analyzer/pull/1705
* MA0089: fix the single-character constants that are not literals by
@meziantou in https://github.com/meziantou/Meziantou.Analyzer/pull/1706
* MA0004: fix the await expressions without semicolon by @meziantou in
https://github.com/meziantou/Meziantou.Analyzer/pull/1707
**Full Changelog**:
https://github.com/meziantou/Meziantou.Analyzer/compare/3.0.308...3.0.309
## 3.0.308
NuGet package:
<https://www.nuget.org/packages/Meziantou.Analyzer/3.0.308>
## What's Changed
* MA0137, MA0138: do not offer the rename when the name would be empty
or the declaration does not compile by @meziantou in
https://github.com/meziantou/Meziantou.Analyzer/pull/1697
* MA0067: do not report System.Guid used as an attribute by @meziantou
in https://github.com/meziantou/Meziantou.Analyzer/pull/1696
**Full Changelog**:
https://github.com/meziantou/Meziantou.Analyzer/compare/3.0.307...3.0.308
## 3.0.307
NuGet package:
<https://www.nuget.org/packages/Meziantou.Analyzer/3.0.307>
## What's Changed
* MA0002: insert the comparer at the right position when an extension
method is called as a static method by @meziantou in
https://github.com/meziantou/Meziantou.Analyzer/pull/1670
* MA0044: do not offer the code fix when ToString is used as a statement
by @meziantou in
https://github.com/meziantou/Meziantou.Analyzer/pull/1669
* MA0185: do not offer the code fix when string.Create is used as a
statement by @meziantou in
https://github.com/meziantou/Meziantou.Analyzer/pull/1668
* MA0101: do not offer the code fix for interpolated strings by
@meziantou in https://github.com/meziantou/Meziantou.Analyzer/pull/1667
* MA0187: do not offer the code fix when the class has an explicit
constructor by @meziantou in
https://github.com/meziantou/Meziantou.Analyzer/pull/1666
* MA0004: fix the code fix when the await expression is an argument by
@meziantou in https://github.com/meziantou/Meziantou.Analyzer/pull/1665
* MA0102: do not report partial members by @meziantou in
https://github.com/meziantou/Meziantou.Analyzer/pull/1664
* MA0093: do not offer EventArgs.Empty when the event args are generic
by @meziantou in
https://github.com/meziantou/Meziantou.Analyzer/pull/1663
* MA0053: do not report classes used as generic constraints by
@meziantou in https://github.com/meziantou/Meziantou.Analyzer/pull/1662
* Overload finder: Half is not implicitly convertible to float or double
by @meziantou in
https://github.com/meziantou/Meziantou.Analyzer/pull/1661
* MA0042, MA0045: make the enclosing function async in the code fix by
@meziantou in https://github.com/meziantou/Meziantou.Analyzer/pull/1660
**Full Changelog**:
https://github.com/meziantou/Meziantou.Analyzer/compare/3.0.306...3.0.307
## 3.0.306
NuGet package:
<https://www.nuget.org/packages/Meziantou.Analyzer/3.0.306>
## What's Changed
* Allow the fuzzer to open up to 50 issues per run by @meziantou in
https://github.com/meziantou/Meziantou.Analyzer/pull/1652
* Build the fuzz project after the other builds of build_with_analyzers
by @meziantou in
https://github.com/meziantou/Meziantou.Analyzer/pull/1671
* MA0038: fix the analyzer crash on invalid code and the code fixes that
break the code by @meziantou in
https://github.com/meziantou/Meziantou.Analyzer/pull/1653
* MA0194: do not throw on invalid code by @meziantou in
https://github.com/meziantou/Meziantou.Analyzer/pull/1654
* MA0009, MA0023: do not throw when the GeneratedRegex arguments are
invalid by @meziantou in
https://github.com/meziantou/Meziantou.Analyzer/pull/1655
* MA0110: do not report invalid patterns and fix the partial property
used as a statement by @meziantou in
https://github.com/meziantou/Meziantou.Analyzer/pull/1656
* MA0182: remove all the parts of a partial type and analyze the
delegate signatures by @meziantou in
https://github.com/meziantou/Meziantou.Analyzer/pull/1657
* MA0036: do not report classes that contain protected members by
@meziantou in https://github.com/meziantou/Meziantou.Analyzer/pull/1658
* MA0137, MA0138: do not rename a method to a name that is already used
by @meziantou in
https://github.com/meziantou/Meziantou.Analyzer/pull/1659
**Full Changelog**:
https://github.com/meziantou/Meziantou.Analyzer/compare/3.0.305...3.0.306
## 3.0.305
NuGet package:
<https://www.nuget.org/packages/Meziantou.Analyzer/3.0.305>
## What's Changed
* MA0008: do not overflow the stack on cyclic struct layouts by
@meziantou in https://github.com/meziantou/Meziantou.Analyzer/pull/1640
**Full Changelog**:
https://github.com/meziantou/Meziantou.Analyzer/compare/3.0.304...3.0.305
## 3.0.304
NuGet package:
<https://www.nuget.org/packages/Meziantou.Analyzer/3.0.304>
## What's Changed
* Add fuzz tests for the analyzers and the code fixers by @meziantou in
https://github.com/meziantou/Meziantou.Analyzer/pull/1641
**Full Changelog**:
https://github.com/meziantou/Meziantou.Analyzer/compare/3.0.303...3.0.304
## 3.0.303
NuGet package:
<https://www.nuget.org/packages/Meziantou.Analyzer/3.0.303>
## What's Changed
* MA0100: do not look up GetAwaiter for the types that cannot be awaited
by @meziantou in
https://github.com/meziantou/Meziantou.Analyzer/pull/1635
* Reduce the time spent in MA0154, MA0218 and MA0219 by @meziantou in
https://github.com/meziantou/Meziantou.Analyzer/pull/1638
* Reduce the time spent in MA0182 by @meziantou in
https://github.com/meziantou/Meziantou.Analyzer/pull/1636
* Reduce the time spent in MA0134 by @meziantou in
https://github.com/meziantou/Meziantou.Analyzer/pull/1637
**Full Changelog**:
https://github.com/meziantou/Meziantou.Analyzer/compare/3.0.302...3.0.303
## 3.0.302
NuGet package:
<https://www.nuget.org/packages/Meziantou.Analyzer/3.0.302>
## What's Changed
* Reduce the time spent in MA0001, MA0002, MA0011, MA0026, MA0074 and
MA0150 by @meziantou in
https://github.com/meziantou/Meziantou.Analyzer/pull/1634
**Full Changelog**:
https://github.com/meziantou/Meziantou.Analyzer/compare/3.0.301...3.0.302
## 3.0.301
NuGet package:
<https://www.nuget.org/packages/Meziantou.Analyzer/3.0.301>
## What's Changed
* Reduce the CPU and the memory used by MA0202 by @meziantou in
https://github.com/meziantou/Meziantou.Analyzer/pull/1633
**Full Changelog**:
https://github.com/meziantou/Meziantou.Analyzer/compare/3.0.300...3.0.301
## 3.0.300
NuGet package:
<https://www.nuget.org/packages/Meziantou.Analyzer/3.0.300>
## What's Changed
* MA0015, MA0043: do not enumerate all the symbols in scope by
@meziantou in https://github.com/meziantou/Meziantou.Analyzer/pull/1632
**Full Changelog**:
https://github.com/meziantou/Meziantou.Analyzer/compare/3.0.299...3.0.300
## 3.0.299
NuGet package:
<https://www.nuget.org/packages/Meziantou.Analyzer/3.0.299>
## What's Changed
* MA0031: do not suggest Skip(n).Any() when the value is not a constant
by @meziantou in
https://github.com/meziantou/Meziantou.Analyzer/pull/1631
* chore(deps): update all dependencies by @renovate[bot] in
https://github.com/meziantou/Meziantou.Analyzer/pull/1627
**Full Changelog**:
https://github.com/meziantou/Meziantou.Analyzer/compare/3.0.298...3.0.299
## 3.0.298
NuGet package:
<https://www.nuget.org/packages/Meziantou.Analyzer/3.0.298>
## What's Changed
* chore(deps): update dependency meziantou.framework.roslyn to 1.2.1 by
@renovate[bot] in
https://github.com/meziantou/Meziantou.Analyzer/pull/1629
**Full Changelog**:
https://github.com/meziantou/Meziantou.Analyzer/compare/3.0.297...3.0.298
## 3.0.297
NuGet package:
<https://www.nuget.org/packages/Meziantou.Analyzer/3.0.297>
## What's Changed
* Update Meziantou.NET.Sdk to 1.0.183 and use its SharedHttpClient by
@meziantou in https://github.com/meziantou/Meziantou.Analyzer/pull/1628
**Full Changelog**:
https://github.com/meziantou/Meziantou.Analyzer/compare/3.0.296...3.0.297
## 3.0.296
NuGet package:
<https://www.nuget.org/packages/Meziantou.Analyzer/3.0.296>
## What's Changed
* Add tests for non-culture-sensitive string methods by @meziantou in
https://github.com/meziantou/Meziantou.Analyzer/pull/1626
**Full Changelog**:
https://github.com/meziantou/Meziantou.Analyzer/compare/3.0.295...3.0.296
## 3.0.295
NuGet package:
<https://www.nuget.org/packages/Meziantou.Analyzer/3.0.295>
## What's Changed
* MA0002: treat the xunit assertions that take an IEqualityComparer<T>
as ordinal with report_only_non_ordinal by @vencyk in
https://github.com/meziantou/Meziantou.Analyzer/pull/1625
## New Contributors
* @vencyk made their first contribution in
https://github.com/meziantou/Meziantou.Analyzer/pull/1625
**Full Changelog**:
https://github.com/meziantou/Meziantou.Analyzer/compare/3.0.294...3.0.295
## 3.0.294
NuGet package:
<https://www.nuget.org/packages/Meziantou.Analyzer/3.0.294>
## What's Changed
* Do not suggest instance members in static contexts in MA0166/MA0167 by
@meziantou in https://github.com/meziantou/Meziantou.Analyzer/pull/1623
**Full Changelog**:
https://github.com/meziantou/Meziantou.Analyzer/compare/3.0.293...3.0.294
## 3.0.293
NuGet package:
<https://www.nuget.org/packages/Meziantou.Analyzer/3.0.293>
## What's Changed
* Check for a set instance only before an MA0002 report by
@alexander-efremov in
https://github.com/meziantou/Meziantou.Analyzer/pull/1622
**Full Changelog**:
https://github.com/meziantou/Meziantou.Analyzer/compare/3.0.292...3.0.293
## 3.0.292
NuGet package:
<https://www.nuget.org/packages/Meziantou.Analyzer/3.0.292>
## What's Changed
* Cache LookupSymbols results in OverloadFinder by @alexander-efremov
in https://github.com/meziantou/Meziantou.Analyzer/pull/1621
* chore(deps): update all dependencies to 1.0.179 by @renovate[bot] in
https://github.com/meziantou/Meziantou.Analyzer/pull/1618
## New Contributors
* @alexander-efremov made their first contribution in
https://github.com/meziantou/Meziantou.Analyzer/pull/1621
**Full Changelog**:
https://github.com/meziantou/Meziantou.Analyzer/compare/3.0.291...3.0.292
## 3.0.291
NuGet package:
<https://www.nuget.org/packages/Meziantou.Analyzer/3.0.291>
## What's Changed
* Do not merge is patterns declaring variables in the MA0194 code fix by
@meziantou in https://github.com/meziantou/Meziantou.Analyzer/pull/1620
**Full Changelog**:
https://github.com/meziantou/Meziantou.Analyzer/compare/3.0.290...3.0.291
## 3.0.290
NuGet package:
<https://www.nuget.org/packages/Meziantou.Analyzer/3.0.290>
## What's Changed
* Use IsAssignableTo where IsOrInheritsFrom was meant to check
assignability by @meziantou in
https://github.com/meziantou/Meziantou.Analyzer/pull/1616
**Full Changelog**:
https://github.com/meziantou/Meziantou.Analyzer/compare/3.0.289...3.0.290
## 3.0.289
NuGet package:
<https://www.nuget.org/packages/Meziantou.Analyzer/3.0.289>
## What's Changed
* Fix code fix crash when adding an argument to a conditional access
invocation by @meziantou in
https://github.com/meziantou/Meziantou.Analyzer/pull/1617
* Share the search of available CancellationToken and TimeProvider
values by @meziantou in
https://github.com/meziantou/Meziantou.Analyzer/pull/1612
* Use IOperation instead of SyntaxNode in MA0050 by @meziantou in
https://github.com/meziantou/Meziantou.Analyzer/pull/1613
* Remove MA0212 by @meziantou in
https://github.com/meziantou/Meziantou.Analyzer/pull/1615
* Skip every special type when searching for
CancellationToken/TimeProvider members by @meziantou in
https://github.com/meziantou/Meziantou.Analyzer/pull/1614
**Full Changelog**:
https://github.com/meziantou/Meziantou.Analyzer/compare/3.0.288...3.0.289
## 3.0.288
NuGet package:
<https://www.nuget.org/packages/Meziantou.Analyzer/3.0.288>
## What's Changed
* Add MA0242: Use a value factory with
ConcurrentDictionary.GetOrAdd/AddOrUpdate when the value is expensive by
@meziantou in https://github.com/meziantou/Meziantou.Analyzer/pull/1611
**Full Changelog**:
https://github.com/meziantou/Meziantou.Analyzer/compare/3.0.287...3.0.288
## 3.0.287
NuGet package:
<https://www.nuget.org/packages/Meziantou.Analyzer/3.0.287>
## What's Changed
* Test and document the records in MA0197, MA0198 and MA0199 by
@meziantou in https://github.com/meziantou/Meziantou.Analyzer/pull/1555
* Fix MA0042 false positives, false negatives and code fix crashes by
@meziantou in https://github.com/meziantou/Meziantou.Analyzer/pull/1560
**Full Changelog**:
https://github.com/meziantou/Meziantou.Analyzer/compare/3.0.286...3.0.287
## 3.0.286
NuGet package:
<https://www.nuget.org/packages/Meziantou.Analyzer/3.0.286>
## What's Changed
* Fix MA0171 false positives in nameof and conditional access by
@meziantou in https://github.com/meziantou/Meziantou.Analyzer/pull/1562
**Full Changelog**:
https://github.com/meziantou/Meziantou.Analyzer/compare/3.0.285...3.0.286
## 3.0.285
NuGet package:
<https://www.nuget.org/packages/Meziantou.Analyzer/3.0.285>
## What's Changed
* Fix MA0071 code fix when the locals of the else clause conflict with
other identifiers by @meziantou in
https://github.com/meziantou/Meziantou.Analyzer/pull/1565
* Fix MA0150 false positive on user-defined operators returning a string
by @meziantou in
https://github.com/meziantou/Meziantou.Analyzer/pull/1596
* Fix MA0214 false positives in unsafe contexts and after using
declarations by @meziantou in
https://github.com/meziantou/Meziantou.Analyzer/pull/1602
* Fix MA0028 code fixes for AppendLine with a one-char interpolated
string, no-op calls, and char[].ToString() by @meziantou in
https://github.com/meziantou/Meziantou.Analyzer/pull/1603
**Full Changelog**:
https://github.com/meziantou/Meziantou.Analyzer/compare/3.0.284...3.0.285
## 3.0.284
NuGet package:
<https://www.nuget.org/packages/Meziantou.Analyzer/3.0.284>
## What's Changed
* Fix MA0003 code fix not applied to the arguments of indexers by
@meziantou in https://github.com/meziantou/Meziantou.Analyzer/pull/1609
**Full Changelog**:
https://github.com/meziantou/Meziantou.Analyzer/compare/3.0.283...3.0.284
## 3.0.283
NuGet package:
<https://www.nuget.org/packages/Meziantou.Analyzer/3.0.283>
## What's Changed
* Do not offer the MA0202 code fix to merge non-adjacent branches by
@meziantou in https://github.com/meziantou/Meziantou.Analyzer/pull/1580
* Fix the LINQ optimization rules on predicates, casts, ordering and
collection interfaces by @meziantou in
https://github.com/meziantou/Meziantou.Analyzer/pull/1585
* Fix MA0003 exclusions applied to the arguments of target-typed new
expressions by @meziantou in
https://github.com/meziantou/Meziantou.Analyzer/pull/1594
* Fix MA0123 checking the wrong argument when the arguments are named by
@meziantou in https://github.com/meziantou/Meziantou.Analyzer/pull/1564
**Full Changelog**:
https://github.com/meziantou/Meziantou.Analyzer/compare/3.0.282...3.0.283
## 3.0.282
NuGet package:
<https://www.nuget.org/packages/Meziantou.Analyzer/3.0.282>
## What's Changed
* Fix MA0070 not reported on field-targeted attributes of
auto-properties by @meziantou in
https://github.com/meziantou/Meziantou.Analyzer/pull/1601
* Fix MA0090 code fix changing the if statement an outer else belongs to
by @meziantou in
https://github.com/meziantou/Meziantou.Analyzer/pull/1574
* Fix MA0096 code fix when CompareTo is implemented explicitly by
@meziantou in https://github.com/meziantou/Meziantou.Analyzer/pull/1579
* Fix MA0145 on non-static accessors and MA0146 on constructor accessors
by @meziantou in
https://github.com/meziantou/Meziantou.Analyzer/pull/1575
**Full Changelog**:
https://github.com/meziantou/Meziantou.Analyzer/compare/3.0.281...3.0.282
## 3.0.281
NuGet package:
<https://www.nuget.org/packages/Meziantou.Analyzer/3.0.281>
## What's Changed
* Fix MA0061 code fix for default values declared in a referenced
assembly by @meziantou in
https://github.com/meziantou/Meziantou.Analyzer/pull/1605
* Fix MA0137 false positive on user-defined operators and conversions by
@meziantou in https://github.com/meziantou/Meziantou.Analyzer/pull/1606
* Fix MA0139 false positive when the Serilog params array is passed as
an array by @meziantou in
https://github.com/meziantou/Meziantou.Analyzer/pull/1607
**Full Changelog**:
https://github.com/meziantou/Meziantou.Analyzer/compare/3.0.280...3.0.281
## 3.0.280
NuGet package:
<https://www.nuget.org/packages/Meziantou.Analyzer/3.0.280>
## What's Changed
* Fix MA0004 using the ConfigureAwait of nested functions to detect the
context by @meziantou in
https://github.com/meziantou/Meziantou.Analyzer/pull/1593
* Fix MA0172 false positive on operands with side effects by @meziantou
in https://github.com/meziantou/Meziantou.Analyzer/pull/1578
* Fix MA0151 false positive on members of containing types and
namespaces by @meziantou in
https://github.com/meziantou/Meziantou.Analyzer/pull/1592
* Fix MA0128 behavior change when a string span is compared to an empty
string by @meziantou in
https://github.com/meziantou/Meziantou.Analyzer/pull/1591
* Fix MA0040 suggesting static, write-only, and indexer members as
cancellation tokens by @meziantou in
https://github.com/meziantou/Meziantou.Analyzer/pull/1577
* Fix MA0036 false positive on classes used as a type in declarations by
@meziantou in https://github.com/meziantou/Meziantou.Analyzer/pull/1576
* Fix MA0163 false positive when the ProcessStartInfo is assigned to
Process.StartInfo by @meziantou in
https://github.com/meziantou/Meziantou.Analyzer/pull/1586
* Fix MA0048 only_validate_first_type when the first type is a delegate
by @meziantou in
https://github.com/meziantou/Meziantou.Analyzer/pull/1595
* Fix MA0194 merging is expressions on values converted by a cast by
@meziantou in https://github.com/meziantou/Meziantou.Analyzer/pull/1608
**Full Changelog**:
https://github.com/meziantou/Meziantou.Analyzer/compare/3.0.279...3.0.280
## 3.0.279
NuGet package:
<https://www.nuget.org/packages/Meziantou.Analyzer/3.0.279>
## What's Changed
* Fix MA0100 false positive on returns nested before a using declaration
by @meziantou in
https://github.com/meziantou/Meziantou.Analyzer/pull/1572
* Fix MA0056 false positive on members accessed with base by @meziantou
in https://github.com/meziantou/Meziantou.Analyzer/pull/1584
* Fix MA0091 false positive on instance events raised from a static
context by @meziantou in
https://github.com/meziantou/Meziantou.Analyzer/pull/1588
* Fix MA0054 false negative on exceptions of a derived type by
@meziantou in https://github.com/meziantou/Meziantou.Analyzer/pull/1590
* Fix MA0102 code fix copying the modifiers of the reported accessor to
the other accessor by @meziantou in
https://github.com/meziantou/Meziantou.Analyzer/pull/1598
* Fix MA0046 reporting override events by @meziantou in
https://github.com/meziantou/Meziantou.Analyzer/pull/1599
**Full Changelog**:
https://github.com/meziantou/Meziantou.Analyzer/compare/3.0.278...3.0.279
## 3.0.278
NuGet package:
<https://www.nuget.org/packages/Meziantou.Analyzer/3.0.278>
## What's Changed
* Fix the MA0082 code fix for operands of another type or nullable
operands by @meziantou in
https://github.com/meziantou/Meziantou.Analyzer/pull/1570
* Fix MA0103 code fix when the left operand is implicitly converted to a
span by @meziantou in
https://github.com/meziantou/Meziantou.Analyzer/pull/1566
* Fix MA0141, MA0142, MA0148 and MA0149 false positives on dynamic
operands by @meziantou in
https://github.com/meziantou/Meziantou.Analyzer/pull/1567
* Fix MA0037 code fix crash on embedded empty statements by @meziantou
in https://github.com/meziantou/Meziantou.Analyzer/pull/1568
**Full Changelog**:
https://github.com/meziantou/Meziantou.Analyzer/compare/3.0.277...3.0.278
## 3.0.277
NuGet package:
<https://www.nuget.org/packages/Meziantou.Analyzer/3.0.277>
## What's Changed
* Fix MA0170 on non-public setters and System.Enum parameters by
@meziantou in https://github.com/meziantou/Meziantou.Analyzer/pull/1571
**Full Changelog**:
https://github.com/meziantou/Meziantou.Analyzer/compare/3.0.276...3.0.277
## 3.0.276
NuGet package:
<https://www.nuget.org/packages/Meziantou.Analyzer/3.0.276>
## What's Changed
* Fix MA0022 code fix dropping non-null branches and false positive in
async methods by @meziantou in
https://github.com/meziantou/Meziantou.Analyzer/pull/1558
* Fix MA0204 false positive on types with partial members by @meziantou
in https://github.com/meziantou/Meziantou.Analyzer/pull/1559
* Fix MA0109 false positive on generic methods with a Span overload by
@meziantou in https://github.com/meziantou/Meziantou.Analyzer/pull/1561
* Fix MA0173 when the value contains an await or an out variable
declaration by @meziantou in
https://github.com/meziantou/Meziantou.Analyzer/pull/1563
* Fix MA0050 when an await precedes the argument validation by
@meziantou in https://github.com/meziantou/Meziantou.Analyzer/pull/1583
* Fix MA0166 on types that derive from TimeProvider and on non-readable
members by @meziantou in
https://github.com/meziantou/Meziantou.Analyzer/pull/1582
* Fix MA0110 code fix referencing local constants in the GeneratedRegex
attribute by @meziantou in
https://github.com/meziantou/Meziantou.Analyzer/pull/1581
**Full Changelog**:
https://github.com/meziantou/Meziantou.Analyzer/compare/3.0.275...3.0.276
## 3.0.275
NuGet package:
<https://www.nuget.org/packages/Meziantou.Analyzer/3.0.275>
## What's Changed
* chore(deps): update dependency microsoft.bcl.asyncinterfaces to
10.0.12 by @renovate[bot] in
https://github.com/meziantou/Meziantou.Analyzer/pull/1546
* Fix MA0182 false positives on types used in nested patterns, events
and self-referencing types by @meziantou in
https://github.com/meziantou/Meziantou.Analyzer/pull/1549
* Fix MA0215 false positives on await foreach, await using, and
top-level statements by @meziantou in
https://github.com/meziantou/Meziantou.Analyzer/pull/1550
* Fix MA0009 and MA0023 with named arguments and GeneratedRegex culture
name by @meziantou in
https://github.com/meziantou/Meziantou.Analyzer/pull/1552
* Fix MA0067 false positive on default parameter values by @meziantou
in https://github.com/meziantou/Meziantou.Analyzer/pull/1553
* Fix duplicate diagnostics of the XML comment rules on shared
documentation comments by @meziantou in
https://github.com/meziantou/Meziantou.Analyzer/pull/1554
* Fix MA0073 false positive on user-defined equality operators by
@meziantou in https://github.com/meziantou/Meziantou.Analyzer/pull/1556
**Full Changelog**:
https://github.com/meziantou/Meziantou.Analyzer/compare/3.0.274...3.0.275
## 3.0.274
NuGet package:
<https://www.nuget.org/packages/Meziantou.Analyzer/3.0.274>
## What's Changed
* Add semantic functions to the XPath queries of MA0240 by @meziantou
in https://github.com/meziantou/Meziantou.Analyzer/pull/1548
**Full Changelog**:
https://github.com/meziantou/Meziantou.Analyzer/compare/3.0.273...3.0.274
## 3.0.273
NuGet package:
<https://www.nuget.org/packages/Meziantou.Analyzer/3.0.273>
## What's Changed
* Expose the kind-specific modifiers of the symbols in the XPath queries
of MA0240 by @meziantou in
https://github.com/meziantou/Meziantou.Analyzer/pull/1547
**Full Changelog**:
https://github.com/meziantou/Meziantou.Analyzer/compare/3.0.272...3.0.273
## 3.0.272
NuGet package:
<https://www.nuget.org/packages/Meziantou.Analyzer/3.0.272>
## What's Changed
* Query the symbols with the XPath queries of MA0240 by @meziantou in
https://github.com/meziantou/Meziantou.Analyzer/pull/1545
**Full Changelog**:
https://github.com/meziantou/Meziantou.Analyzer/compare/3.0.271...3.0.272
## 3.0.271
NuGet package:
<https://www.nuget.org/packages/Meziantou.Analyzer/3.0.271>
## What's Changed
* Expose more of Roslyn to the XPath queries of MA0240 by @meziantou in
https://github.com/meziantou/Meziantou.Analyzer/pull/1544
**Full Changelog**:
https://github.com/meziantou/Meziantou.Analyzer/compare/3.0.270...3.0.271
## 3.0.270
NuGet package:
<https://www.nuget.org/packages/Meziantou.Analyzer/3.0.270>
## What's Changed
* Reduce the CPU and the memory used by the rules by @meziantou in
https://github.com/meziantou/Meziantou.Analyzer/pull/1542
* chore(deps): update dependency dotnet-sdk to v10.0.401 by
@renovate[bot] in
https://github.com/meziantou/Meziantou.Analyzer/pull/1543
**Full Changelog**:
https://github.com/meziantou/Meziantou.Analyzer/compare/3.0.269...3.0.270
## 3.0.269
NuGet package:
<https://www.nuget.org/packages/Meziantou.Analyzer/3.0.269>
## What's Changed
* Reduce the cost of the XPath queries of MA0240 by @meziantou in
https://github.com/meziantou/Meziantou.Analyzer/pull/1541
**Full Changelog**:
https://github.com/meziantou/Meziantou.Analyzer/compare/3.0.268...3.0.269
## 3.0.268
NuGet package:
<https://www.nuget.org/packages/Meziantou.Analyzer/3.0.268>
## What's Changed
* Query the operations with the XPath queries of MA0240 by @meziantou
in https://github.com/meziantou/Meziantou.Analyzer/pull/1540
**Full Changelog**:
https://github.com/meziantou/Meziantou.Analyzer/compare/3.0.267...3.0.268
## 3.0.267
NuGet package:
<https://www.nuget.org/packages/Meziantou.Analyzer/3.0.267>
## What's Changed
* Support a custom severity in the banned syntax entries of MA0240 by
@meziantou in https://github.com/meziantou/Meziantou.Analyzer/pull/1539
**Full Changelog**:
https://github.com/meziantou/Meziantou.Analyzer/compare/3.0.266...3.0.267
## 3.0.266
NuGet package:
<https://www.nuget.org/packages/Meziantou.Analyzer/3.0.266>
## What's Changed
* Expose more of the semantic model to the XPath queries of MA0240 by
@meziantou in https://github.com/meziantou/Meziantou.Analyzer/pull/1538
* chore(deps): update all dependencies by @renovate[bot] in
https://github.com/meziantou/Meziantou.Analyzer/pull/1524
**Full Changelog**:
https://github.com/meziantou/Meziantou.Analyzer/compare/3.0.265...3.0.266
## 3.0.265
NuGet package:
<https://www.nuget.org/packages/Meziantou.Analyzer/3.0.265>
## What's Changed
* Expose the semantic model to the XPath queries of MA0240 by
@meziantou in https://github.com/meziantou/Meziantou.Analyzer/pull/1537
**Full Changelog**:
https://github.com/meziantou/Meziantou.Analyzer/compare/3.0.264...3.0.265
## 3.0.264
NuGet package:
<https://www.nuget.org/packages/Meziantou.Analyzer/3.0.264>
## What's Changed
* Replace the concurrent collections of MA0234 with locked collections
by @meziantou in
https://github.com/meziantou/Meziantou.Analyzer/pull/1536
**Full Changelog**:
https://github.com/meziantou/Meziantou.Analyzer/compare/3.0.263...3.0.264
## 3.0.263
NuGet package:
<https://www.nuget.org/packages/Meziantou.Analyzer/3.0.263>
## What's Changed
* Add MA0240: Do not use banned syntax, and MA0241 for invalid entries
by @meziantou in
https://github.com/meziantou/Meziantou.Analyzer/pull/1535
**Full Changelog**:
https://github.com/meziantou/Meziantou.Analyzer/compare/3.0.262...3.0.263
## 3.0.262
NuGet package:
<https://www.nuget.org/packages/Meziantou.Analyzer/3.0.262>
## What's Changed
* Parallelize the steps of the create_nuget CI job by @meziantou in
https://github.com/meziantou/Meziantou.Analyzer/pull/1532
**Full Changelog**:
https://github.com/meziantou/Meziantou.Analyzer/compare/3.0.261...3.0.262
## 3.0.261
NuGet package:
<https://www.nuget.org/packages/Meziantou.Analyzer/3.0.261>
## What's Changed
* Do not report MA0005 for the params array synthesized by a collection
expression by @meziantou in
https://github.com/meziantou/Meziantou.Analyzer/pull/1531
**Full Changelog**:
https://github.com/meziantou/Meziantou.Analyzer/compare/3.0.260...3.0.261
## 3.0.260
NuGet package:
<https://www.nuget.org/packages/Meziantou.Analyzer/3.0.260>
## What's Changed
* Add tests for code paths not covered by the test suite by @meziantou
in https://github.com/meziantou/Meziantou.Analyzer/pull/1527
* Do not report MA0028 for concatenation of constant strings and chars
by @meziantou in
https://github.com/meziantou/Meziantou.Analyzer/pull/1529
**Full Changelog**:
https://github.com/meziantou/Meziantou.Analyzer/compare/3.0.259...3.0.260
## 3.0.259
NuGet package:
<https://www.nuget.org/packages/Meziantou.Analyzer/3.0.259>
## What's Changed
* Only generate the polyfills used by the code by @meziantou in
https://github.com/meziantou/Meziantou.Analyzer/pull/1526
**Full Changelog**:
https://github.com/meziantou/Meziantou.Analyzer/compare/3.0.258...3.0.259
## 3.0.258
NuGet package:
<https://www.nuget.org/packages/Meziantou.Analyzer/3.0.258>
## What's Changed
* chore(deps): update dependency meziantou.framework.roslyn to 1.2.0 by
@renovate[bot] in
https://github.com/meziantou/Meziantou.Analyzer/pull/1525
**Full Changelog**:
https://github.com/meziantou/Meziantou.Analyzer/compare/3.0.257...3.0.258
## 3.0.257
NuGet package:
<https://www.nuget.org/packages/Meziantou.Analyzer/3.0.257>
## What's Changed
* Use GetTypeByMetadataName unless the type is commonly declared as
internal in several assemblies by @meziantou in
https://github.com/meziantou/Meziantou.Analyzer/pull/1523
**Full Changelog**:
https://github.com/meziantou/Meziantou.Analyzer/compare/3.0.256...3.0.257
## 3.0.256
NuGet package:
<https://www.nuget.org/packages/Meziantou.Analyzer/3.0.256>
## What's Changed
* Fix metadata names that could never resolve in MA0003, MA0001 and
MA0060 by @meziantou in
https://github.com/meziantou/Meziantou.Analyzer/pull/1522
**Full Changelog**:
https://github.com/meziantou/Meziantou.Analyzer/compare/3.0.255...3.0.256
## 3.0.255
NuGet package:
<https://www.nuget.org/packages/Meziantou.Analyzer/3.0.255>
## What's Changed
* Add an option to include extension methods from namespaces that are
not imported in the rules using OverloadFinder by @meziantou in
https://github.com/meziantou/Meziantou.Analyzer/pull/1521
**Full Changelog**:
https://github.com/meziantou/Meziantou.Analyzer/compare/3.0.254...3.0.255
## 3.0.254
NuGet package:
<https://www.nuget.org/packages/Meziantou.Analyzer/3.0.254>
## What's Changed
* Remove the unreachable string.Join branch of MA0089 by @meziantou in
https://github.com/meziantou/Meziantou.Analyzer/pull/1504
* Fix MA0018 reporting one diagnostic per event accessor by @meziantou
in https://github.com/meziantou/Meziantou.Analyzer/pull/1505
* chore(deps): update all dependencies to 1.0.172 by @renovate[bot] in
https://github.com/meziantou/Meziantou.Analyzer/pull/1507
* Report MA0070 on every declaration that can be obsolete by @meziantou
in https://github.com/meziantou/Meziantou.Analyzer/pull/1508
* Remove the discarded message argument of MA0080 by @meziantou in
https://github.com/meziantou/Meziantou.Analyzer/pull/1509
* Report MA0068 on the parameter and property placements of
NotNullIfNotNull by @meziantou in
https://github.com/meziantou/Meziantou.Analyzer/pull/1510
* Include the preprocessor trivia in the MA0202 branch comparison by
@meziantou in https://github.com/meziantou/Meziantou.Analyzer/pull/1511
* Report MA0179 when the constant is on the left of the length
comparison by @meziantou in
https://github.com/meziantou/Meziantou.Analyzer/pull/1512
* Fix the MA0166 message saying "available tokens" by @meziantou in
https://github.com/meziantou/Meziantou.Analyzer/pull/1513
* Detect the ConfigureAwait of the async enumerable in the MA0004
foreach analysis by @meziantou in
https://github.com/meziantou/Meziantou.Analyzer/pull/1506
* Report MA0206 on record struct and interface declarations by
@meziantou in https://github.com/meziantou/Meziantou.Analyzer/pull/1514
* Report MA0147 on async void method groups by @meziantou in
https://github.com/meziantou/Meziantou.Analyzer/pull/1515
* Report MA0051 on expression bodies of properties, indexers, and
operators by @meziantou in
https://github.com/meziantou/Meziantou.Analyzer/pull/1517
* Clarify the MA0095 comment about the Equals(object) lookup by
@meziantou in https://github.com/meziantou/Meziantou.Analyzer/pull/1518
* Report relational and generic math NaN comparisons in MA0082 by
@meziantou in https://github.com/meziantou/Meziantou.Analyzer/pull/1519
* Cache the MA0042 "no async equivalent" results per call-site scope by
@meziantou in https://github.com/meziantou/Meziantou.Analyzer/pull/1520
* Report the contextual keywords in MA0154 by @meziantou in
https://github.com/meziantou/Meziantou.Analyzer/pull/1516
**Full Changelog**:
https://github.com/meziantou/Meziantou.Analyzer/compare/3.0.253...3.0.254
## 3.0.253
NuGet package:
<https://www.nuget.org/packages/Meziantou.Analyzer/3.0.253>
## What's Changed
* Share the argument list logic of the code fixes that add an argument
by @meziantou in
https://github.com/meziantou/Meziantou.Analyzer/pull/1503
**Full Changelog**:
https://github.com/meziantou/Meziantou.Analyzer/compare/3.0.252...3.0.253
## 3.0.252
NuGet package:
<https://www.nuget.org/packages/Meziantou.Analyzer/3.0.252>
## What's Changed
* Preserve the variable scope in the MA0004 code fix by @meziantou in
https://github.com/meziantou/Meziantou.Analyzer/pull/1502
**Full Changelog**:
https://github.com/meziantou/Meziantou.Analyzer/compare/3.0.251...3.0.252
## 3.0.251
NuGet package:
<https://www.nuget.org/packages/Meziantou.Analyzer/3.0.251>
## What's Changed
* Keep the initialization order in the MA0004 code fix by @meziantou in
https://github.com/meziantou/Meziantou.Analyzer/pull/1496
* Do not offer the MA0082 code fix when both operands are NaN by
@meziantou in https://github.com/meziantou/Meziantou.Analyzer/pull/1497
* Report MA0224/MA0225 when an earlier assignment configures another
instance by @meziantou in
https://github.com/meziantou/Meziantou.Analyzer/pull/1498
* Fix MA0040 inserting the CancellationToken in an invalid argument
position by @meziantou in
https://github.com/meziantou/Meziantou.Analyzer/pull/1499
* Preserve argument binding in the MA0074 code fix by @meziantou in
https://github.com/meziantou/Meziantou.Analyzer/pull/1500
* Fix MA0011 inserting the IFormatProvider in an invalid argument
position by @meziantou in
https://github.com/meziantou/Meziantou.Analyzer/pull/1501
**Full Changelog**:
https://github.com/meziantou/Meziantou.Analyzer/compare/3.0.250...3.0.251
## 3.0.250
NuGet package:
<https://www.nuget.org/packages/Meziantou.Analyzer/3.0.250>
## What's Changed
* Report MA0163 when an assignment cannot fix the configuration used by
Process.Start by @meziantou in
https://github.com/meziantou/Meziantou.Analyzer/pull/1489
* Fix MA0166 inserting the TimeProvider in an invalid argument position
by @meziantou in
https://github.com/meziantou/Meziantou.Analyzer/pull/1490
* Do not report MA0214 when the function cannot be made async by
@meziantou in https://github.com/meziantou/Meziantou.Analyzer/pull/1491
* Preserve argument binding in the MA0108 code fix by @meziantou in
https://github.com/meziantou/Meziantou.Analyzer/pull/1492
* Add the type to the parameter added by the MA0106 code fix on a typed
lambda by @meziantou in
https://github.com/meziantou/Meziantou.Analyzer/pull/1495
**Full Changelog**:
https://github.com/meziantou/Meziantou.Analyzer/compare/3.0.249...3.0.250
## 3.0.249
NuGet package:
<https://www.nuget.org/packages/Meziantou.Analyzer/3.0.249>
## What's Changed
* MA0177: preserve nested XML elements such as <see/> when collapsing by
@meziantou in https://github.com/meziantou/Meziantou.Analyzer/pull/1481
* Fix MA0184 code fix keeping doubled braces as literal text by
@meziantou in https://github.com/meziantou/Meziantou.Analyzer/pull/1465
* Do not report MA0209/MA0210 for arguments that cannot be passed by
reference by @meziantou in
https://github.com/meziantou/Meziantou.Analyzer/pull/1469
* Do not report MA0148/MA0149 when the constant does not convert to the
operand type by @meziantou in
https://github.com/meziantou/Meziantou.Analyzer/pull/1470
* Do not report MA0028 for string.Join overloads without an AppendJoin
equivalent by @meziantou in
https://github.com/meziantou/Meziantou.Analyzer/pull/1475
* chore(deps): update all dependencies by @renovate[bot] in
https://github.com/meziantou/Meziantou.Analyzer/pull/1477
* Fix MA0193 code fix producing invalid calls with named arguments by
@meziantou in https://github.com/meziantou/Meziantou.Analyzer/pull/1486
* Do not report MA0173 when the value cannot be captured by a lambda by
@meziantou in https://github.com/meziantou/Meziantou.Analyzer/pull/1487
* Do not report MA0106 when the factory writes the captured variable by
@meziantou in https://github.com/meziantou/Meziantou.Analyzer/pull/1488
**Full Changelog**:
https://github.com/meziantou/Meziantou.Analyzer/compare/3.0.248...3.0.249
## 3.0.248
NuGet package:
<https://www.nuget.org/packages/Meziantou.Analyzer/3.0.248>
## What's Changed
* Do not report MA0065 when the invoked equality member is overridden by
@meziantou in https://github.com/meziantou/Meziantou.Analyzer/pull/1485
* Do not report MA0152 when the inner await suppresses the exceptions by
@meziantou in https://github.com/meziantou/Meziantou.Analyzer/pull/1484
**Full Changelog**:
https://github.com/meziantou/Meziantou.Analyzer/compare/3.0.247...3.0.248
## 3.0.247
NuGet package:
<https://www.nuget.org/packages/Meziantou.Analyzer/3.0.247>
## What's Changed
* Do not report MA0215 when ConfigureAwait changes what the method does
by @meziantou in
https://github.com/meziantou/Meziantou.Analyzer/pull/1483
**Full Changelog**:
https://github.com/meziantou/Meziantou.Analyzer/compare/3.0.246...3.0.247
## 3.0.246
NuGet package:
<https://www.nuget.org/packages/Meziantou.Analyzer/3.0.246>
## What's Changed
* Fix MA0158 code fix when the field is assigned in another document by
@meziantou in https://github.com/meziantou/Meziantou.Analyzer/pull/1478
* Do not report MA0173 when the return value of CompareExchange is used
by @meziantou in
https://github.com/meziantou/Meziantou.Analyzer/pull/1479
* Do not report MA0066 on ImmutableSortedDictionary by @meziantou in
https://github.com/meziantou/Meziantou.Analyzer/pull/1480
**Full Changelog**:
https://github.com/meziantou/Meziantou.Analyzer/compare/3.0.245...3.0.246
## 3.0.245
NuGet package:
<https://www.nuget.org/packages/Meziantou.Analyzer/3.0.245>
## What's Changed
* Do not report MA0158 when the value cannot be migrated to
System.Threading.Lock by @meziantou in
https://github.com/meziantou/Meziantou.Analyzer/pull/1476
**Full Changelog**:
https://github.com/meziantou/Meziantou.Analyzer/compare/3.0.244...3.0.245
## 3.0.244
NuGet package:
<https://www.nuget.org/packages/Meziantou.Analyzer/3.0.244>
## What's Changed
* Fix MA0028 changing escaped braces when replacing AppendFormat with
Append by @meziantou in
https://github.com/meziantou/Meziantou.Analyzer/pull/1474
**Full Changelog**:
https://github.com/meziantou/Meziantou.Analyzer/compare/3.0.243...3.0.244
## 3.0.243
NuGet package:
<https://www.nuget.org/packages/Meziantou.Analyzer/3.0.243>
## What's Changed
* Do not report MA0078 when the selector does more than casting its
element by @meziantou in
https://github.com/meziantou/Meziantou.Analyzer/pull/1473
**Full Changelog**:
https://github.com/meziantou/Meziantou.Analyzer/compare/3.0.242...3.0.243
Commits viewable in [compare
view](https://github.com/meziantou/Meziantou.Analyzer/commits/3.0.341).
</details>
Updated
[StyleCop.Analyzers](https://github.com/DotNetAnalyzers/StyleCopAnalyzers)
from 1.2.0-beta.556 to 1.3.180.
<details>
<summary>Release notes</summary>
_Sourced from [StyleCop.Analyzers's
releases](https://github.com/DotNetAnalyzers/StyleCopAnalyzers/releases)._
## 1.3.180
This is the first stable StyleCop.Analyzers release since 1.1.118. It
includes the entire 1.2 beta line and the 1.3 revival: the analyzers now
understand C# 8 through the C# 15 previews, many long-standing bugs are
fixed, and the project is once again actively maintained. Thank you to
everyone who contributed code, reviews, translations and bug reports
over the long gap.
## Highlights
- **C# 8 through C# 15 language support.** Rules now understand records
and record structs, file-scoped namespaces, global usings, raw and
interpolated strings, primary constructors, collection expressions,
partial properties, events and constructors, `allows ref struct`, C# 14
extension blocks and the `field` keyword, and C# 15 preview unions with
the `closed` and `safe` modifiers, instead of ignoring that syntax or
crashing on it.
([#4142](https://github.com/DotNetAnalyzers/StyleCopAnalyzers/pull/4142),
[#4139](https://github.com/DotNetAnalyzers/StyleCopAnalyzers/pull/4139),
[#4137](https://github.com/DotNetAnalyzers/StyleCopAnalyzers/pull/4137),
[#4163](https://github.com/DotNetAnalyzers/StyleCopAnalyzers/pull/4163),
[#4148](https://github.com/DotNetAnalyzers/StyleCopAnalyzers/pull/4148),
[#4191](https://github.com/DotNetAnalyzers/StyleCopAnalyzers/pull/4191),
[#4193](https://github.com/DotNetAnalyzers/StyleCopAnalyzers/pull/4193))
- **New rules.** SA1143 checks that wrapped conditional (`?:`)
expressions are laid out consistently, SA1315 requires overriding and
implementing parameters to keep their inherited names, SA1317 reports
identifiers that use letters outside basic Latin A–Z, SA1653 reports
`<summary>` documentation on more than one part of a partial type, and
SA1654 reports escaped generic brackets in `cref`s (for example
`List<T>` vs `List{T}`). SX1412 is an opt-in alternative to SA1412
that requires UTF-8 without a BOM. All of these except SX1412 are on by
default as warnings.
([#3942](https://github.com/DotNetAnalyzers/StyleCopAnalyzers/pull/3942),
[#4299](https://github.com/DotNetAnalyzers/StyleCopAnalyzers/pull/4299),
[#4318](https://github.com/DotNetAnalyzers/StyleCopAnalyzers/pull/4318),
[#4314](https://github.com/DotNetAnalyzers/StyleCopAnalyzers/pull/4314),
[#4315](https://github.com/DotNetAnalyzers/StyleCopAnalyzers/pull/4315),
[#4328](https://github.com/DotNetAnalyzers/StyleCopAnalyzers/pull/4328))
- **Better code fixes.** The member-ordering rules (SA1201, SA1202,
SA1203, SA1204 and SA1214) now offer their code fix, including Fix All.
Many other rules gained fixes, and existing fixes keep comments, trivia,
custom indentation and the document's line endings, and use the
compiler's batch Fix All.
([#4312](https://github.com/DotNetAnalyzers/StyleCopAnalyzers/pull/4312),
[#4076](https://github.com/DotNetAnalyzers/StyleCopAnalyzers/pull/4076),
[#4199](https://github.com/DotNetAnalyzers/StyleCopAnalyzers/pull/4199),
[#4108](https://github.com/DotNetAnalyzers/StyleCopAnalyzers/pull/4108),
[#4229](https://github.com/DotNetAnalyzers/StyleCopAnalyzers/pull/4229),
[#4360](https://github.com/DotNetAnalyzers/StyleCopAnalyzers/pull/4360))
- **More configuration.** Every setting can be set in `.editorconfig`.
New settings include `orderingRules.memberKindOrder`,
`orderingRules.accessibilityOrder` and
`layoutRules.allowBracelessIfStatements` (braceless `if`s are off by
default; the accessibility order default is unchanged).
([#4221](https://github.com/DotNetAnalyzers/StyleCopAnalyzers/pull/4221),
[#3285](https://github.com/DotNetAnalyzers/StyleCopAnalyzers/pull/3285),
[#4324](https://github.com/DotNetAnalyzers/StyleCopAnalyzers/pull/4324),
[#4359](https://github.com/DotNetAnalyzers/StyleCopAnalyzers/pull/4359),
[#4319](https://github.com/DotNetAnalyzers/StyleCopAnalyzers/pull/4319))
- **Fewer false positives and crash fixes.** A long backlog of spacing,
layout, documentation, naming and maintainability issues was cleared,
including several crashes and incorrect code fixes found by fuzzing.
- **Localization and documentation.** This release adds Simplified
Chinese (`zh-CN`) resources and documentation, finishes the Czech
translations, and includes more translations of code-fix documentation
text (Czech, Dutch, Russian and others). Rule documentation and status
are published on GitHub Pages.
([#4285](https://github.com/DotNetAnalyzers/StyleCopAnalyzers/pull/4285),
[#4286](https://github.com/DotNetAnalyzers/StyleCopAnalyzers/pull/4286),
[#3374](https://github.com/DotNetAnalyzers/StyleCopAnalyzers/pull/3374),
[#3944](https://github.com/DotNetAnalyzers/StyleCopAnalyzers/pull/3944),
[#3900](https://github.com/DotNetAnalyzers/StyleCopAnalyzers/pull/3900),
[#4220](https://github.com/DotNetAnalyzers/StyleCopAnalyzers/pull/4220),
[#4218](https://github.com/DotNetAnalyzers/StyleCopAnalyzers/pull/4218))
- **Packaging and engineering.** The package has an icon and a README,
and PDBs are embedded in the DLLs (there is no separate symbols
package). Packages are published from GitHub Actions using nuget.org
trusted publishing. CI runs on GitHub Actions on Linux, the build uses
the .NET 10 SDK, and Renovate keeps dependencies current. The analyzers
still target the same Roslyn version, so they work with the same
compilers and IDEs as before.
([#4320](https://github.com/DotNetAnalyzers/StyleCopAnalyzers/pull/4320),
[#4204](https://github.com/DotNetAnalyzers/StyleCopAnalyzers/pull/4204),
[#4173](https://github.com/DotNetAnalyzers/StyleCopAnalyzers/pull/4173),
[#4123](https://github.com/DotNetAnalyzers/StyleCopAnalyzers/pull/4123),
[#4105](https://github.com/DotNetAnalyzers/StyleCopAnalyzers/pull/4105),
[#4126](https://github.com/DotNetAnalyzers/StyleCopAnalyzers/pull/4126),
[#4231](https://github.com/DotNetAnalyzers/StyleCopAnalyzers/pull/4231))
## Behavior changes worth knowing about
Upgrading from 1.1.118, or from a 1.2 beta, may produce new or different
diagnostics:
- **Rules now cover newer syntax.** Ordering, layout, spacing and
documentation rules now analyze records, primary constructors,
collection expressions, extension blocks, unions and other newer
constructs. They used to skip these, so expect new warnings in code that
uses them.
- **New rules on by default:** SA1143, SA1315, SA1317, SA1653 and SA1654
are enabled as warnings. SX1412 is off by default.
- **Extension members need documentation.** SA1600 no longer treats C#
14 extension blocks as private, so their public members must be
documented. SA1600 also reports undocumented record primary constructor
parameters.
([#4163](https://github.com/DotNetAnalyzers/StyleCopAnalyzers/pull/4163),
[#4213](https://github.com/DotNetAnalyzers/StyleCopAnalyzers/pull/4213))
- **Partial types and members.** For partial methods, properties,
indexers, constructors, events and types, documenting one part is enough
(SA1600 leaves the check for partial members to SA1601). SA1653 reports
a `<summary>` on more than one part, but ignores generated partial
declarations such as WPF `*.g.cs` files.
([#4148](https://github.com/DotNetAnalyzers/StyleCopAnalyzers/pull/4148),
[#4149](https://github.com/DotNetAnalyzers/StyleCopAnalyzers/pull/4149),
[#4152](https://github.com/DotNetAnalyzers/StyleCopAnalyzers/pull/4152),
[#4308](https://github.com/DotNetAnalyzers/StyleCopAnalyzers/pull/4308),
[#4299](https://github.com/DotNetAnalyzers/StyleCopAnalyzers/pull/4299),
[#4393](https://github.com/DotNetAnalyzers/StyleCopAnalyzers/pull/4393))
- **SA1500 and SA1137** now check the brackets of multi-line collection
expressions. SA1137 accepts aligning a closing bracket with an inline
opening bracket (one that follows other code on the same line) or with
the opening line's indentation. Both rules offer an alternate, tab-aware
code fix that aligns the closing bracket with the opening bracket.
([#4396](https://github.com/DotNetAnalyzers/StyleCopAnalyzers/pull/4396),
[#4400](https://github.com/DotNetAnalyzers/StyleCopAnalyzers/pull/4400))
- **SA1642** expects "union" wording in constructor summaries of C# 15
union types, for example "Initializes a new instance of the … union.",
and "interface" rather than "class" in the standard text for static
constructors in interfaces.
([#4193](https://github.com/DotNetAnalyzers/StyleCopAnalyzers/pull/4193),
[#4386](https://github.com/DotNetAnalyzers/StyleCopAnalyzers/pull/4386))
- **SA1121** reports the built-in type inside a using alias target
instead of every use of the alias, and no longer reports `IntPtr` and
`UIntPtr` in XML documentation `cref`s, or in shared source compiled for
targets where `nint` isn't equivalent. SA1121 and SA1125 also report
System types in using alias targets.
([#4287](https://github.com/DotNetAnalyzers/StyleCopAnalyzers/pull/4287),
[#4395](https://github.com/DotNetAnalyzers/StyleCopAnalyzers/pull/4395),
[#4175](https://github.com/DotNetAnalyzers/StyleCopAnalyzers/pull/4175))
- **SA1316** always reports explicitly written tuple element names, even
when `includeInferredTupleElementNames` is off.
([#4202](https://github.com/Dot…
Closes the remaining Roslyn-blocked items in #4182.
Why these rules were held back
Roslyn 5.9.0's analyzer driver runs syntax node actions on a
uniondeclaration twice and on every node inside a union body three times (dotnet/roslyn#84570). As a result, the testing library and the IDE report each union diagnostic two or three times. The command-line compiler only hides exact duplicates. dotnet/roslyn#84604 fixed the driver for 5.10.Test compiler: temporary preview feed
StyleCop.Analyzers.Test.CSharp15now references Microsoft.CodeAnalysis.CSharp.Workspaces 5.10.0-1.26477.9. That is the newest 5.10 build on thedotnet-toolsfeed, and it includes the fix (commit a213b74a).NuGet.configalready lists thedotnet-toolsfeed, and the repo doesn't use package source mapping, soNuGet.configdoesn't change.Microsoft.CodeAnalysis.Analyzersis bumped to 5.10.0-1.26365.3 for this project only. Without it, restore fails with NU1605 (a package downgrade).Rules enabled for unions
Each rule registers its existing callback for
SyntaxKindEx.UnionDeclaration, so code without unions pays nothing extra.<summary>or<content>. Partial methods inside a union follow the merged partial-member policy: one documented part is enough.internal, orprivatewhen nested.DeclarationModifiersHelper.WithModifiers, which now handles unions.Tests
LanguageVersion.Previewexplicitly.LanguageVersionhas noCSharp15value yet, soLightupHelpers.SupportsCSharp15is false, and a plainnew CSharpTest()in the C# 15 project runs with C# 14.