vacuum

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Jun 8, 2026 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const Source = "vacuum"

Variables

This section is empty.

Functions

func Analyzer

func Analyzer(engine *Engine, logger *slog.Logger) treesitter.Analyzer

Analyzer adapts the vacuum bridge into a gossip treesitter analyzer.

func Deduplicate

func Deduplicate(primary []protocol.Diagnostic, secondary []protocol.Diagnostic) []protocol.Diagnostic

Deduplicate keeps all primary diagnostics and drops secondary diagnostics that collide on start position plus a canonical category bucket. The canonical bucket folds aliased rule pairs (for example aliased diagnostics onto a single key so reviewers see one row per underlying rule.

func DeduplicateWithin

func DeduplicateWithin(diags []protocol.Diagnostic) []protocol.Diagnostic

DeduplicateWithin folds aliased rule IDs within a single diagnostic stream. Callers like the lintengine apply this after merging Barrelman + Vacuum results to ensure the combined set does not emit both a canonical slug and its vacuum/spectral/legacy alias for the same source location.

Types

type Engine

type Engine struct {
	// contains filtered or unexported fields
}

Engine wraps pb33f/vacuum execution and maps results onto Telescope's existing diagnostic model.

func NewEngine

func NewEngine(cfg config.VacuumConfig, logger *slog.Logger) (*Engine, error)

NewEngine builds a Vacuum engine using the current process working directory for relative ruleset resolution.

func NewEngineWithBaseDir

func NewEngineWithBaseDir(cfg config.VacuumConfig, baseDir string, logger *slog.Logger) (*Engine, error)

NewEngineWithBaseDir builds a Vacuum engine and resolves relative ruleset paths against baseDir.

func (*Engine) LintAndFix

func (e *Engine) LintAndFix(content []byte, uri string) ([]barrelman.Diagnostic, []byte, error)

LintAndFix applies available vacuum auto-fixes and returns the updated bytes.

func (*Engine) LintBytes

func (e *Engine) LintBytes(content []byte, uri string) ([]barrelman.Diagnostic, error)

LintBytes runs vacuum against raw specification bytes.

Jump to

Keyboard shortcuts

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