Skip to content

Commit

Permalink
Deprecate MA0018 in favor of CA1000 (#571)
Browse files Browse the repository at this point in the history
  • Loading branch information
meziantou authored Jul 21, 2023
1 parent bbdda79 commit e10c56f
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ If you are already using other analyzers, you can check [which rules are duplica
|[MA0015](https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0015.md)|Usage|Specify the parameter name in ArgumentException|⚠️|✔️||
|[MA0016](https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0016.md)|Design|Prefer using collection abstraction instead of implementation|⚠️|✔️||
|[MA0017](https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0017.md)|Design|Abstract types should not have public or internal constructors|⚠️|✔️|✔️|
|[MA0018](https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0018.md)|Design|Do not declare static members on generic types|⚠️|✔️||
|[MA0018](https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0018.md)|Design|Do not declare static members on generic types (deprecated; use CA1000 instead)|ℹ️|✔️||
|[MA0019](https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0019.md)|Usage|Use EventArgs.Empty|⚠️|✔️|✔️|
|[MA0020](https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0020.md)|Performance|Use direct methods instead of LINQ methods|ℹ️|✔️|✔️|
|[MA0021](https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0021.md)|Usage|Use StringComparer.GetHashCode instead of string.GetHashCode|⚠️|✔️|✔️|
Expand Down
8 changes: 4 additions & 4 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
|[MA0015](https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0015.md)|Usage|Specify the parameter name in ArgumentException|<span title='Warning'>⚠️</span>|✔️||
|[MA0016](https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0016.md)|Design|Prefer using collection abstraction instead of implementation|<span title='Warning'>⚠️</span>|✔️||
|[MA0017](https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0017.md)|Design|Abstract types should not have public or internal constructors|<span title='Warning'>⚠️</span>|✔️|✔️|
|[MA0018](https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0018.md)|Design|Do not declare static members on generic types|<span title='Warning'>⚠️</span>|✔️||
|[MA0018](https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0018.md)|Design|Do not declare static members on generic types (deprecated; use CA1000 instead)|<span title='Info'>ℹ️</span>|✔️||
|[MA0019](https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0019.md)|Usage|Use EventArgs.Empty|<span title='Warning'>⚠️</span>|✔️|✔️|
|[MA0020](https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0020.md)|Performance|Use direct methods instead of LINQ methods|<span title='Info'>ℹ️</span>|✔️|✔️|
|[MA0021](https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0021.md)|Usage|Use StringComparer.GetHashCode instead of string.GetHashCode|<span title='Warning'>⚠️</span>|✔️|✔️|
Expand Down Expand Up @@ -195,8 +195,8 @@ dotnet_diagnostic.MA0016.severity = warning
# MA0017: Abstract types should not have public or internal constructors
dotnet_diagnostic.MA0017.severity = warning
# MA0018: Do not declare static members on generic types
dotnet_diagnostic.MA0018.severity = warning
# MA0018: Do not declare static members on generic types (deprecated; use CA1000 instead)
dotnet_diagnostic.MA0018.severity = suggestion
# MA0019: Use EventArgs.Empty
dotnet_diagnostic.MA0019.severity = warning
Expand Down Expand Up @@ -598,7 +598,7 @@ dotnet_diagnostic.MA0016.severity = none
# MA0017: Abstract types should not have public or internal constructors
dotnet_diagnostic.MA0017.severity = none
# MA0018: Do not declare static members on generic types
# MA0018: Do not declare static members on generic types (deprecated; use CA1000 instead)
dotnet_diagnostic.MA0018.severity = none
# MA0019: Use EventArgs.Empty
Expand Down
2 changes: 1 addition & 1 deletion docs/Rules/MA0018.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# MA0018 - Do not declare static members on generic types
# MA0018 - Do not declare static members on generic types (deprecated; use CA1000 instead)

When a static member of a generic type is called, the type argument must be specified for the type.
When a generic instance member that does not support inference is called, the type argument must be specified for the member.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ public sealed class DoNotDeclareStaticMembersOnGenericTypes : DiagnosticAnalyzer
{
private static readonly DiagnosticDescriptor s_rule = new(
RuleIdentifiers.DoNotDeclareStaticMembersOnGenericTypes,
title: "Do not declare static members on generic types",
messageFormat: "Do not declare static members on generic types",
title: "Do not declare static members on generic types (deprecated; use CA1000 instead)",
messageFormat: "Do not declare static members on generic types (deprecated; use CA1000 instead)",
RuleCategories.Design,
DiagnosticSeverity.Warning,
DiagnosticSeverity.Info,
isEnabledByDefault: true,
description: "",
helpLinkUri: RuleIdentifiers.GetHelpUri(RuleIdentifiers.DoNotDeclareStaticMembersOnGenericTypes));
Expand Down

0 comments on commit e10c56f

Please sign in to comment.