diff --git a/app/SourceCodeRules/SourceCodeRules/Identifier.cs b/app/SourceCodeRules/SourceCodeRules/Identifier.cs new file mode 100644 index 00000000..acbc1d55 --- /dev/null +++ b/app/SourceCodeRules/SourceCodeRules/Identifier.cs @@ -0,0 +1,7 @@ +namespace SourceCodeRules; + +public static class Identifier +{ + public const string PROVIDER_ACCESS_ANALYZER = $"{Tools.ID_PREFIX}0001"; + public const string CONST_STATIC_ANALYZER = $"{Tools.ID_PREFIX}0002"; +} \ No newline at end of file diff --git a/app/SourceCodeRules/SourceCodeRules/NamingAnalyzers/ConstStaticAnalyzer.cs b/app/SourceCodeRules/SourceCodeRules/NamingAnalyzers/ConstStaticAnalyzer.cs index 89cfec69..d3273132 100644 --- a/app/SourceCodeRules/SourceCodeRules/NamingAnalyzers/ConstStaticAnalyzer.cs +++ b/app/SourceCodeRules/SourceCodeRules/NamingAnalyzers/ConstStaticAnalyzer.cs @@ -13,7 +13,7 @@ namespace SourceCodeRules.NamingAnalyzers; #pragma warning restore RS1038 public sealed class ConstStaticAnalyzer : DiagnosticAnalyzer { - private const string DIAGNOSTIC_ID = $"{Tools.ID_PREFIX}0002"; + private const string DIAGNOSTIC_ID = Identifier.CONST_STATIC_ANALYZER; private static readonly string TITLE = "Constant and static fields must be in UPPER_CASE"; diff --git a/app/SourceCodeRules/SourceCodeRules/NamingCodeFixes/ConstStaticCodeFixProvider.cs b/app/SourceCodeRules/SourceCodeRules/NamingCodeFixes/ConstStaticCodeFixProvider.cs index 89a4f313..8b8d8c89 100644 --- a/app/SourceCodeRules/SourceCodeRules/NamingCodeFixes/ConstStaticCodeFixProvider.cs +++ b/app/SourceCodeRules/SourceCodeRules/NamingCodeFixes/ConstStaticCodeFixProvider.cs @@ -16,7 +16,7 @@ namespace SourceCodeRules.NamingCodeFixes; [ExportCodeFixProvider(LanguageNames.CSharp, Name = nameof(ConstStaticCodeFixProvider)), Shared] public sealed class ConstStaticCodeFixProvider : CodeFixProvider { - public override ImmutableArray FixableDiagnosticIds => [$"{Tools.ID_PREFIX}0002"]; + public override ImmutableArray FixableDiagnosticIds => [Identifier.CONST_STATIC_ANALYZER]; public override FixAllProvider GetFixAllProvider() => WellKnownFixAllProviders.BatchFixer; diff --git a/app/SourceCodeRules/SourceCodeRules/UsageAnalyzers/ProviderAccessAnalyzer.cs b/app/SourceCodeRules/SourceCodeRules/UsageAnalyzers/ProviderAccessAnalyzer.cs index 160505e6..a2db69df 100644 --- a/app/SourceCodeRules/SourceCodeRules/UsageAnalyzers/ProviderAccessAnalyzer.cs +++ b/app/SourceCodeRules/SourceCodeRules/UsageAnalyzers/ProviderAccessAnalyzer.cs @@ -13,7 +13,7 @@ namespace SourceCodeRules.UsageAnalyzers; #pragma warning restore RS1038 public sealed class ProviderAccessAnalyzer : DiagnosticAnalyzer { - private const string DIAGNOSTIC_ID = $"{Tools.ID_PREFIX}0001"; + private const string DIAGNOSTIC_ID = Identifier.PROVIDER_ACCESS_ANALYZER; private static readonly string TITLE = "Direct access to `Providers` is not allowed";