30 lines
820 B
C#
30 lines
820 B
C#
using SQLLinter.Common;
|
|
|
|
namespace SQLLinter.Infrastructure.Rules.RuleViolations
|
|
{
|
|
public class RuleViolation : IRuleViolation
|
|
{
|
|
required public string FileName { get; init; }
|
|
|
|
required public int Column { get; set; }
|
|
|
|
required public int Line { get; set; }
|
|
|
|
required public string RuleName { get; init; }
|
|
|
|
required public RuleViolationSeverity Severity { get; init; }
|
|
|
|
virtual public string Text { get; set; }
|
|
public BaseRuleVisitor.ExtractedBlock? Snippet { get; set; }
|
|
}
|
|
|
|
public class RuleTemplateViolation : RuleViolation
|
|
{
|
|
override public string Text => string.Format(RuleTemplate, Params.ToArray());
|
|
|
|
required public string RuleTemplate { get; init; }
|
|
|
|
public List<string> Params { get; set; } = new();
|
|
}
|
|
}
|