linter

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2025 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ApplyRuleFixes

func ApplyRuleFixes[M LintMessage](code string, diagnostics []M) (string, []M, bool)

func RunLinter

func RunLinter(programs []*compiler.Program, singleThreaded bool, allowFiles []string, getRulesForFile func(sourceFile *ast.SourceFile) []ConfiguredRule, onDiagnostic func(diagnostic rule.RuleDiagnostic)) (int32, error)

when allowedFiles is passed as nil which means all files are allowed when allowedFiles is passed as slice, only files in the slice are allowed

Types

type ConfiguredRule

type ConfiguredRule struct {
	Name     string
	Severity rule.DiagnosticSeverity
	Run      func(ctx rule.RuleContext) rule.RuleListeners
}

type LintMessage

type LintMessage interface {
	Fixes() []rule.RuleFix
}

Jump to

Keyboard shortcuts

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