|
@@ -9,7 +9,7 @@ namespace ET.Analyzer
|
|
|
private const string MessageFormat = "方法: {0} 在非异步方法体内使用时需要添加.Coroutine()后缀";
|
|
private const string MessageFormat = "方法: {0} 在非异步方法体内使用时需要添加.Coroutine()后缀";
|
|
|
|
|
|
|
|
private const string Description = "ETTask方法调用在非异步方法体内使用错误.";
|
|
private const string Description = "ETTask方法调用在非异步方法体内使用错误.";
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
public static readonly DiagnosticDescriptor Rule =
|
|
public static readonly DiagnosticDescriptor Rule =
|
|
|
new DiagnosticDescriptor(DiagnosticIds.ETTaskInSyncMethodAnalyzerRuleId,
|
|
new DiagnosticDescriptor(DiagnosticIds.ETTaskInSyncMethodAnalyzerRuleId,
|
|
|
Title,
|
|
Title,
|
|
@@ -19,7 +19,7 @@ namespace ET.Analyzer
|
|
|
true,
|
|
true,
|
|
|
Description);
|
|
Description);
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
public static class ETTaskInAsyncMethodAnalyzerRule
|
|
public static class ETTaskInAsyncMethodAnalyzerRule
|
|
|
{
|
|
{
|
|
|
private const string Title = "ETTask方法调用在异步方法体内使用错误";
|
|
private const string Title = "ETTask方法调用在异步方法体内使用错误";
|
|
@@ -27,7 +27,7 @@ namespace ET.Analyzer
|
|
|
private const string MessageFormat = "方法: {0} 在异步方法体内使用时需要添加await前缀 或 .Coroutine()后缀";
|
|
private const string MessageFormat = "方法: {0} 在异步方法体内使用时需要添加await前缀 或 .Coroutine()后缀";
|
|
|
|
|
|
|
|
private const string Description = "ETTask方法调用在异步方法体内使用错误.";
|
|
private const string Description = "ETTask方法调用在异步方法体内使用错误.";
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
public static readonly DiagnosticDescriptor Rule =
|
|
public static readonly DiagnosticDescriptor Rule =
|
|
|
new DiagnosticDescriptor(DiagnosticIds.ETTaskInAsyncMethodAnalyzerRuleId,
|
|
new DiagnosticDescriptor(DiagnosticIds.ETTaskInAsyncMethodAnalyzerRuleId,
|
|
|
Title,
|
|
Title,
|
|
@@ -45,7 +45,7 @@ namespace ET.Analyzer
|
|
|
private const string MessageFormat = "类: {0} Id字段: {1}的值: {2} 不在约束的区间内, 请修改";
|
|
private const string MessageFormat = "类: {0} Id字段: {1}的值: {2} 不在约束的区间内, 请修改";
|
|
|
|
|
|
|
|
private const string Description = "唯一Id字段数值区间约束.";
|
|
private const string Description = "唯一Id字段数值区间约束.";
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
public static readonly DiagnosticDescriptor Rule =
|
|
public static readonly DiagnosticDescriptor Rule =
|
|
|
new DiagnosticDescriptor(DiagnosticIds.UniqueIdRangeAnalyzerRuleId,
|
|
new DiagnosticDescriptor(DiagnosticIds.UniqueIdRangeAnalyzerRuleId,
|
|
|
Title,
|
|
Title,
|
|
@@ -63,7 +63,7 @@ namespace ET.Analyzer
|
|
|
private const string MessageFormat = "类: {0} Id字段: {1}的值: {2} 与其他Id字段值重复, 请修改";
|
|
private const string MessageFormat = "类: {0} Id字段: {1}的值: {2} 与其他Id字段值重复, 请修改";
|
|
|
|
|
|
|
|
private const string Description = "唯一Id字段禁止重复.";
|
|
private const string Description = "唯一Id字段禁止重复.";
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
public static readonly DiagnosticDescriptor Rule =
|
|
public static readonly DiagnosticDescriptor Rule =
|
|
|
new DiagnosticDescriptor(DiagnosticIds.UniqueIdDuplicateAnalyzerRuleId,
|
|
new DiagnosticDescriptor(DiagnosticIds.UniqueIdDuplicateAnalyzerRuleId,
|
|
|
Title,
|
|
Title,
|
|
@@ -81,7 +81,7 @@ namespace ET.Analyzer
|
|
|
private const string MessageFormat = "Type: {0} 不允许作为实体: {1} 的AddChild函数参数类型! 若要允许该类型作为参数,请使用ChildOfAttribute对child实体类标记父级类型";
|
|
private const string MessageFormat = "Type: {0} 不允许作为实体: {1} 的AddChild函数参数类型! 若要允许该类型作为参数,请使用ChildOfAttribute对child实体类标记父级类型";
|
|
|
|
|
|
|
|
private const string Description = "AddChild方法类型约束错误.";
|
|
private const string Description = "AddChild方法类型约束错误.";
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
public static readonly DiagnosticDescriptor Rule =
|
|
public static readonly DiagnosticDescriptor Rule =
|
|
|
new DiagnosticDescriptor(DiagnosticIds.AddChildTypeAnalyzerRuleId,
|
|
new DiagnosticDescriptor(DiagnosticIds.AddChildTypeAnalyzerRuleId,
|
|
|
Title,
|
|
Title,
|
|
@@ -91,7 +91,7 @@ namespace ET.Analyzer
|
|
|
true,
|
|
true,
|
|
|
Description);
|
|
Description);
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
public static class DisableAccessEntityChildAnalyzerRule
|
|
public static class DisableAccessEntityChildAnalyzerRule
|
|
|
{
|
|
{
|
|
|
private const string Title = "禁止在Entity类中直接调用Child和Component";
|
|
private const string Title = "禁止在Entity类中直接调用Child和Component";
|
|
@@ -99,7 +99,7 @@ namespace ET.Analyzer
|
|
|
private const string MessageFormat = "禁止在Entity类中直接调用Child和Component";
|
|
private const string MessageFormat = "禁止在Entity类中直接调用Child和Component";
|
|
|
|
|
|
|
|
private const string Description = "禁止在Entity类中直接调用Child和Component.";
|
|
private const string Description = "禁止在Entity类中直接调用Child和Component.";
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
public static readonly DiagnosticDescriptor Rule =
|
|
public static readonly DiagnosticDescriptor Rule =
|
|
|
new DiagnosticDescriptor(DiagnosticIds.DisableUseChildComponentInEntityAnalyzerRuleId,
|
|
new DiagnosticDescriptor(DiagnosticIds.DisableUseChildComponentInEntityAnalyzerRuleId,
|
|
|
Title,
|
|
Title,
|
|
@@ -117,7 +117,7 @@ namespace ET.Analyzer
|
|
|
private const string MessageFormat = "组件类型: {0} 不允许作为实体: {1} 的组件类型! 若要允许该类型作为参数,请使用ComponentOfAttribute对组件类标记父级实体类型";
|
|
private const string MessageFormat = "组件类型: {0} 不允许作为实体: {1} 的组件类型! 若要允许该类型作为参数,请使用ComponentOfAttribute对组件类标记父级实体类型";
|
|
|
|
|
|
|
|
private const string Description = "实体类添加或获取组件类型错误.";
|
|
private const string Description = "实体类添加或获取组件类型错误.";
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
public static readonly DiagnosticDescriptor Rule =
|
|
public static readonly DiagnosticDescriptor Rule =
|
|
|
new DiagnosticDescriptor(DiagnosticIds.EntityComponentAnalyzerRuleId,
|
|
new DiagnosticDescriptor(DiagnosticIds.EntityComponentAnalyzerRuleId,
|
|
|
Title,
|
|
Title,
|
|
@@ -127,6 +127,22 @@ namespace ET.Analyzer
|
|
|
true,
|
|
true,
|
|
|
Description);
|
|
Description);
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
|
|
+ public static class StaticFieldDeclarationAnalyzerRule
|
|
|
|
|
+ {
|
|
|
|
|
+ private const string Title = "Static字段声明需要标记标签";
|
|
|
|
|
+
|
|
|
|
|
+ private const string MessageFormat = "Static字段声明 {0} 需要标记标签";
|
|
|
|
|
+
|
|
|
|
|
+ private const string Description = "Static字段声明需要标记标签.";
|
|
|
|
|
+
|
|
|
|
|
+ public static readonly DiagnosticDescriptor Rule =
|
|
|
|
|
+ new DiagnosticDescriptor(DiagnosticIds.StaticFieldDeclarationAnalyzerRule,
|
|
|
|
|
+ Title,
|
|
|
|
|
+ MessageFormat,
|
|
|
|
|
+ DiagnosticCategories.All,
|
|
|
|
|
+ DiagnosticSeverity.Error,
|
|
|
|
|
+ true,
|
|
|
|
|
+ Description);
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|