mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2025-04-28 15:39:46 +00:00
Refactored the identifiers
This commit is contained in:
parent
a33347ddb7
commit
12e876525a
7
app/SourceCodeRules/SourceCodeRules/Identifier.cs
Normal file
7
app/SourceCodeRules/SourceCodeRules/Identifier.cs
Normal file
@ -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";
|
||||||
|
}
|
@ -13,7 +13,7 @@ namespace SourceCodeRules.NamingAnalyzers;
|
|||||||
#pragma warning restore RS1038
|
#pragma warning restore RS1038
|
||||||
public sealed class ConstStaticAnalyzer : DiagnosticAnalyzer
|
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";
|
private static readonly string TITLE = "Constant and static fields must be in UPPER_CASE";
|
||||||
|
|
||||||
|
@ -16,7 +16,7 @@ namespace SourceCodeRules.NamingCodeFixes;
|
|||||||
[ExportCodeFixProvider(LanguageNames.CSharp, Name = nameof(ConstStaticCodeFixProvider)), Shared]
|
[ExportCodeFixProvider(LanguageNames.CSharp, Name = nameof(ConstStaticCodeFixProvider)), Shared]
|
||||||
public sealed class ConstStaticCodeFixProvider : CodeFixProvider
|
public sealed class ConstStaticCodeFixProvider : CodeFixProvider
|
||||||
{
|
{
|
||||||
public override ImmutableArray<string> FixableDiagnosticIds => [$"{Tools.ID_PREFIX}0002"];
|
public override ImmutableArray<string> FixableDiagnosticIds => [Identifier.CONST_STATIC_ANALYZER];
|
||||||
|
|
||||||
public override FixAllProvider GetFixAllProvider() => WellKnownFixAllProviders.BatchFixer;
|
public override FixAllProvider GetFixAllProvider() => WellKnownFixAllProviders.BatchFixer;
|
||||||
|
|
||||||
|
@ -13,7 +13,7 @@ namespace SourceCodeRules.UsageAnalyzers;
|
|||||||
#pragma warning restore RS1038
|
#pragma warning restore RS1038
|
||||||
public sealed class ProviderAccessAnalyzer : DiagnosticAnalyzer
|
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";
|
private static readonly string TITLE = "Direct access to `Providers` is not allowed";
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user