Добавлено формирование детальной ошибки

This commit is contained in:
FrigaT
2025-12-28 14:18:54 +03:00
parent e4acae11f0
commit cc7809871e
14 changed files with 1090 additions and 14 deletions

View File

@@ -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)