msbuild: Change CodeAnalysis rules from 'Info' to 'Warning' after fixing all instances of the violations
As a follow up to #5656 each code analysis rule that is marked as Action="Info" should be evaluated and migrated to Action="Warning" once all instances of the violations are fixed or marked with ignore.
To make the process as painless as possible. Each rule should be implemented in its own PR.
Before the merges:
List of rules to enable after resolving occurrences:
- CA1050 - #7195 #7227
- CA1070 - #7231
- CA1200 - #7194
- CA1507 - #7176
- CA1802 - #7177
- CA1805 - #7251
- CA1810 - #7179
- CA1823 - #7180
- CA1825 - #7181
- CA1827 - #7207
- CA1829 - #7182
- CA1834 - #7183
- CA1835 - #7184
- CA1836 - #7185
- CA1837 - Cannot use
Environment.ProcessIdbecause it isn’t available in older versions of .NET. When the team decides to no longer support versions below .NET 5 then this can be enabled. - CA1838 - #7186
- CA2007
- CA2008
- CA2016 - #7188
- CA2208 - #7187
- CA2241 - #7190
- CA2249 - not totally possible due to required string.contains method signatures not being available in older .NET versions.
- CA3075
- CA3076
- CA3077
- CA5350 - #7233
- CA5384 - #7234
- SA0001
- SA1002 - #7199
- SA1004 - #7204
- SA1005 - #7259
- SA1006 - #7232
- SA1008
- SA1009
- SA1010 - #7205
- SA1011
- SA1012
- SA1013
- SA1014- #7235
- SA1015- #7236
- SA1020- #7237
- SA1021
- SA1023 - #7238
- SA1024 - #7266
- SA1025
- SA1100
- SA1102 - #7261
- SA1106
- SA1107
- SA1110 - https://github.com/dotnet/msbuild/pull/8336
- SA1111 - https://github.com/dotnet/msbuild/pull/8336
- SA1114
- SA1116
- SA1117
- SA1120
- SA1122 - #7239
- SA1123
- SA1125 - #7201
- SA1127 - #7267
- SA1128
- SA1130
- SA1131
- SA1132 - #7240
- SA1133 - #7262
- SA1134 - #7263
- SA1135 - #7264
- SA1136 - #7203
- SA1137
- SA1201
- SA1202
- SA1203
- SA1204
- SA1208
- SA1209
- SA1210
- SA1211
- SA1214
- SA1216 - #7265
- SA1217
- SA1300
- SA1302 - #7268
- SA1303
- SA1304
- SA1306
- SA1308
- SA1311
- SA1312
- SA1313
- SA1316
- SA1401
- SA1402
- SA1403
- SA1404
- SA1405
- SA1407
- SA1408 - #7269
- SA1413
- SA1414
- SA1500
- SA1501
- SA1502
- SA1503
- SA1504 - #7270
- SA1505 - #7272
- SA1506 - #7271
- SA1507
- SA1508 - #7273
- SA1509 - #7274
- SA1510 - #7275
- SA1512
- SA1513
- SA1514
- SA1515
- SA1516
- SA1518 - #7571
- SA1519 - #7276
- SA1520 - #7198
- SA1601
- SA1602
- SA1604
- SA1605
- SA1606
- SA1608
- SA1610
- SA1611
- SA1612
- SA1614
- SA1616
- SA1618
- SA1619
- SA1622
- SA1623
- SA1624
- SA1626- #7197
- SA1627
- SA1629
- SA1633 - Superseded by IDE0073
- SA1642
- SA1643 - #7196
- SA1649
About this issue
- Original URL
- State: open
- Created 3 years ago
- Reactions: 3
- Comments: 26 (26 by maintainers)
Commits related to this issue
- CA1050: Declare types in namespaces (#7227) Fixes #7195 Relates to #7174 https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca1050 — committed to dotnet/msbuild by elachlan 2 years ago
- CA5350 Do Not Use Weak Cryptographic Algorithms (#7233) Relates to #7174 https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/CA5350 I just updated the suppression att... — committed to dotnet/msbuild by elachlan 2 years ago
- SA1102 Query clause should follow previous clause (#7261) Relates to #7174 https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1102.md — committed to dotnet/msbuild by elachlan 2 years ago
- SA1504 All accessors should be single-line or multi-line (#7270) Relates to #7174 https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1504.md — committed to dotnet/msbuild by elachlan 2 years ago
- SA1626 single-line comment which begins with three forward slashes in… (#7197) Relates to #7174 https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1626.md Co-authore... — committed to dotnet/msbuild by elachlan 2 years ago
- SA1302 Interface names should begin with I (#7268) Relates to #7174 https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1302.md — committed to dotnet/msbuild by elachlan 2 years ago
- SA1509 Opening braces should not be preceded by blank line (#7274) Relates to #7174 https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1509.md — committed to dotnet/msbuild by elachlan 2 years ago
- CA2241 Provide correct arguments to formatting methods (#7190) Relates to #7174 — committed to dotnet/msbuild by elachlan 2 years ago
- CA1823 Avoid unused private fields (#7180) Relates to #7174 — committed to dotnet/msbuild by elachlan 2 years ago
- CA1810 Initialize reference type static fields inline (#7179) Relates to #7174 — committed to dotnet/msbuild by elachlan 2 years ago
- CA1838 Avoid 'StringBuilder' parameters for P/Invokes (#7186) Relates to #7174 https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca1838 There is extensive discussio... — committed to dotnet/msbuild by elachlan 2 years ago
- SA1518 - The line endings at the end of a file do not match the setti… (#7571) Relates to #7174 https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1518.md The two re... — committed to dotnet/msbuild by elachlan 2 years ago
I’d like to wait to see what sharwell suggests. Personally, both solutions sound problematic in their own ways, and although I’d personally be fine with wasting a couple gbs, I suspect at least one person on my team will be strongly opposed. On the other hand, it would be frustrating to have a massive .editorconfig.
One other option I think we should at least consider is only promoting analysis messages to warnings if we can do some without a warning coming from anything we depend on. That’s a stupid requirement, but it may be the most pragmatic. We have a lot of issues we want to tackle for 17.2 with major customer impact, and you’ve probably noticed we’re pretty far behind even with just reviewing and merging what’s already open.