Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
19c2357c04 | ||
|
|
3c4eda7f57 | ||
|
|
119d94b0e8 | ||
|
|
bf6c0b9229 |
@@ -44,7 +44,7 @@ namespace SQLLinter.CLI
|
||||
["UpperLower"] = Common.RuleViolationSeverity.Critical,
|
||||
["SetVariable"] = Common.RuleViolationSeverity.Critical,
|
||||
},
|
||||
GenerateDetails = false,
|
||||
GenerateDetails = true,
|
||||
};
|
||||
|
||||
//var linter = new Linter(con, rep);
|
||||
@@ -62,30 +62,30 @@ namespace SQLLinter.CLI
|
||||
|
||||
Dictionary<string, Stream> files = new();
|
||||
|
||||
for (int i = 0; i < 2; i++)
|
||||
for (int i = 0; i < 15; i++)
|
||||
{
|
||||
files[name + i + ".sql"] = reader.BaseStream;
|
||||
}
|
||||
|
||||
linter.Run(files);
|
||||
//diagramer.Run("test.sql", reader.BaseStream);
|
||||
diagramer.Run("test.sql", reader.BaseStream);
|
||||
}
|
||||
|
||||
//linter.Run(@"C:\Users\frost\Desktop\DISTR-2599\test.sql");
|
||||
|
||||
IReportFormatter formatter = new F.v3.HtmlReportFormatter();
|
||||
var content = formatter.Format(rep.Violations, null);
|
||||
var content = formatter.Format(rep.Violations, bpmn);
|
||||
|
||||
File.WriteAllText(@"C:\Users\frost\Downloads\Telegram Desktop\test3.html", content);
|
||||
|
||||
|
||||
formatter = new F.v2.HtmlReportFormatter();
|
||||
content = formatter.Format(rep.Violations, null);
|
||||
content = formatter.Format(rep.Violations, bpmn);
|
||||
File.WriteAllText(@"C:\Users\frost\Downloads\Telegram Desktop\test2.html", content);
|
||||
|
||||
|
||||
formatter = new F.v1.HtmlReportFormatter();
|
||||
content = formatter.Format(rep.Violations, null);
|
||||
content = formatter.Format(rep.Violations, bpmn);
|
||||
File.WriteAllText(@"C:\Users\frost\Downloads\Telegram Desktop\test1.html", content);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -104,6 +104,14 @@ public abstract class BaseRuleVisitor : TSqlFragmentVisitor, IRule
|
||||
case SchemaObjectFunctionTableReference:
|
||||
return current;
|
||||
|
||||
// DML
|
||||
case InsertStatement:
|
||||
case UpdateStatement:
|
||||
case DeleteStatement:
|
||||
case MergeStatement:
|
||||
return current;
|
||||
|
||||
|
||||
// ---- Новые блоки для SqlDataTypeReference ----
|
||||
|
||||
// Определение столбца
|
||||
@@ -160,10 +168,12 @@ public abstract class BaseRuleVisitor : TSqlFragmentVisitor, IRule
|
||||
if (node == null || node.ScriptTokenStream == null)
|
||||
return null;
|
||||
|
||||
var endLine = node.ScriptTokenStream.Where(t => t.Offset < node.StartOffset + node.FragmentLength).Max(t => t.Line) + 2;
|
||||
|
||||
// 1. Получаем токены для блока
|
||||
var tokens = node.ScriptTokenStream
|
||||
.Where(t => t.Line >= node.StartLine &&
|
||||
t.Offset < node.StartOffset + node.FragmentLength)
|
||||
.Where(t => t.Line >= node.StartLine - 2 &&
|
||||
t.Line <= endLine)
|
||||
.ToList();
|
||||
|
||||
if (tokens.Count == 0)
|
||||
|
||||
@@ -143,6 +143,6 @@ public class HtmlReportFormatter : IReportFormatter
|
||||
sb.AppendLine("</body>");
|
||||
sb.AppendLine("</html>");
|
||||
|
||||
return HtmlMinifier.MinifyHtml(sb.ToString());
|
||||
return sb.ToString();
|
||||
}
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -225,7 +225,7 @@ public class HtmlReportFormatter : IReportFormatter
|
||||
var lineClass = "code-line";
|
||||
if (isErrorLine)
|
||||
{
|
||||
lineClass += " error-line";
|
||||
lineClass += $" {errorSeverity}-line";
|
||||
}
|
||||
|
||||
sb.Append($"<div class=\"{lineClass}\">");
|
||||
|
||||
Reference in New Issue
Block a user