feat(lint): lint PL/pgSQL function and DO bodies, report body syntax errors

This commit is contained in:
Hein
2026-10-06 16:44:08 +02:00
parent 96ee6c659b
commit 8dbf0f8fcb
4 changed files with 240 additions and 0 deletions
+6
View File
@@ -93,6 +93,12 @@ func (e *Engine) Check(sql, file string) ([]diagnostics.Diagnostic, error) {
all = append(all, found...)
}
bodies := e.checkBodies(sql, result.Stmts)
for i := range bodies {
bodies[i].File = file
}
all = append(all, bodies...)
sort.Slice(all, func(i, j int) bool {
if all[i].Line != all[j].Line {
return all[i].Line < all[j].Line