4 Commits

Author SHA1 Message Date
FrigaT
19c2357c04 из html v1 убарана минификация (возвращено к стоку)
All checks were successful
CI / build-test (push) Successful in 35s
Release / pack-and-publish (release) Successful in 31s
2025-12-28 23:33:34 +03:00
FrigaT
3c4eda7f57 Доработан js2
All checks were successful
CI / build-test (push) Successful in 40s
Release / pack-and-publish (release) Successful in 47s
2025-12-28 23:26:51 +03:00
FrigaT
119d94b0e8 изменен стиль v2 html 2025-12-28 23:25:51 +03:00
FrigaT
bf6c0b9229 Доработан js 2025-12-28 20:10:37 +03:00
6 changed files with 1698 additions and 2767 deletions

View File

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

View File

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

View File

@@ -143,6 +143,6 @@ public class HtmlReportFormatter : IReportFormatter
sb.AppendLine("</body>");
sb.AppendLine("</html>");
return HtmlMinifier.MinifyHtml(sb.ToString());
return sb.ToString();
}
}

View File

@@ -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}\">");