Добавлено формирование детальной ошибки
This commit is contained in:
@@ -3,6 +3,7 @@ using SQLLinter.Common;
|
||||
using SQLLinter.Core.Interfaces;
|
||||
using SQLLinter.Infrastructure.Configuration.Overrides;
|
||||
using SQLLinter.Infrastructure.Interfaces;
|
||||
using SQLLinter.Infrastructure.Rules;
|
||||
using SQLLinter.Infrastructure.Rules.RuleExceptions;
|
||||
using SQLLinter.Infrastructure.Rules.RuleViolations;
|
||||
using System.Data;
|
||||
@@ -38,6 +39,8 @@ public class SqlRuleVisitor : IRuleVisitor
|
||||
|
||||
if (sqlFragment == null) return;
|
||||
|
||||
var parentMap = ParentMapBuilder.Build(sqlFragment);
|
||||
|
||||
var ruleExceptions = ignoredRules as IRuleException[] ?? ignoredRules.ToArray();
|
||||
if (errors.Any())
|
||||
{
|
||||
@@ -47,6 +50,7 @@ public class SqlRuleVisitor : IRuleVisitor
|
||||
var rules = _pluginHandler.Rules;
|
||||
foreach (var rule in rules)
|
||||
{
|
||||
rule.SetParents(parentMap);
|
||||
VisitFragment(sqlFragment, rule, overrideArray, sqlPath);
|
||||
}
|
||||
}
|
||||
@@ -76,7 +80,7 @@ public class SqlRuleVisitor : IRuleVisitor
|
||||
}
|
||||
}
|
||||
|
||||
violations.ForEach(t => _reporter.ReportViolation(filePath, t.Line, t.Column, rule.Severity, t.RuleName, t.Template, t.Params));
|
||||
violations.ForEach(t => _reporter.ReportViolation(filePath, t.Line, t.Column, rule.Severity, t.RuleName, t.Template, t.Snippet, t.Params));
|
||||
}
|
||||
|
||||
private static bool VisitorIsBlackListedForDynamicSql(IRule visitor)
|
||||
|
||||
Reference in New Issue
Block a user