linter

package
v0.22.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 15, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package linter runs warning-only static-analysis rules on write-back content. Since mache-73b885 the rules are SQL over the leyline daemon's emit_ast payload (SQL-shaped `_ast` rows from the SAME parse that validated the write) — no in-process tree-sitter.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Diagnostic

type Diagnostic struct {
	Message string
	Line    uint32
}

Diagnostic is one warning-only lint finding. Line is 0-indexed.

func Lint

func Lint(content []byte, langName string) ([]Diagnostic, error)

Lint checks the content for static analysis issues. Currently supports Go only; other languages return (nil, nil). It costs one leyline validate (emit_ast) round trip — callers that already hold an ASTPayload from the write path's validation should call LintAST instead to reuse that parse.

func LintAST added in v0.18.0

func LintAST(ast *leyline.ASTPayload) ([]Diagnostic, error)

LintAST runs the SQL rules over an already-parsed emit_ast payload — no daemon round trip. A nil payload (pass-through language, or a caller that validated without emit_ast) yields no diagnostics. Non-Go payloads yield no diagnostics: every current rule is Go-specific.

func (Diagnostic) String

func (d Diagnostic) String() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL