Versions in this module Expand all Collapse all v1 v1.6.0 Dec 11, 2025 Changes in this version + func FormatResult(result Result) string + func FormatViolation(v Violation) string + type BaseRule struct + func NewBaseRule(id, name, description string, severity Severity, canAutoFix bool) BaseRule + func (r BaseRule) CanAutoFix() bool + func (r BaseRule) Description() string + func (r BaseRule) ID() string + func (r BaseRule) Name() string + func (r BaseRule) Severity() Severity + type Context struct + AST *ast.AST + Filename string + Lines []string + ParseErr error + SQL string + Tokens []models.TokenWithSpan + func NewContext(sql string, filename string) *Context + func (c *Context) GetLine(lineNum int) string + func (c *Context) GetLineCount() int + func (c *Context) WithAST(astObj *ast.AST, err error) *Context + func (c *Context) WithTokens(tokens []models.TokenWithSpan) *Context + type FileResult struct + Error error + Filename string + Violations []Violation + type Linter struct + func New(rules ...Rule) *Linter + func (l *Linter) LintDirectory(dir string, pattern string) Result + func (l *Linter) LintFile(filename string) FileResult + func (l *Linter) LintFiles(filenames []string) Result + func (l *Linter) LintString(sql string, filename string) FileResult + func (l *Linter) Rules() []Rule + type Result struct + Files []FileResult + TotalFiles int + TotalViolations int + type Rule interface + CanAutoFix func() bool + Check func(ctx *Context) ([]Violation, error) + Description func() string + Fix func(content string, violations []Violation) (string, error) + ID func() string + Name func() string + Severity func() Severity + type Severity string + const SeverityError + const SeverityInfo + const SeverityWarning + type Violation struct + CanAutoFix bool + Line string + Location models.Location + Message string + Rule string + RuleName string + Severity Severity + Suggestion string