linter

package
v0.1.12 Latest Latest
Warning

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

Go to latest
Published: Aug 22, 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, excludedPaths []string, getRulesForFile RuleHandler, onDiagnostic DiagnosticHandler) (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

func RunLinterInProgram added in v0.1.9

func RunLinterInProgram(program *compiler.Program, allowFiles []string, skipFiles []string, getRulesForFile RuleHandler, onDiagnostic DiagnosticHandler) int32

Types

type ConfiguredRule

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

type DiagnosticHandler added in v0.1.9

type DiagnosticHandler = func(diagnostic rule.RuleDiagnostic)

type LintMessage

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

type RuleHandler added in v0.1.9

type RuleHandler = func(sourceFile *ast.SourceFile) []ConfiguredRule

Jump to

Keyboard shortcuts

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