Documentation
¶
Index ¶
- func ApplyRuleFixes[M LintMessage](code string, diagnostics []M) (string, []M, bool)
- func RunLinter(programs []*compiler.Program, singleThreaded bool, allowFiles []string, ...) (int32, error)
- func RunLinterInProgram(program *compiler.Program, allowFiles []string, skipFiles []string, ...) int32
- type ConfiguredRule
- type DiagnosticHandler
- type LintMessage
- type RuleHandler
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 RuleHandler ¶ added in v0.1.9
type RuleHandler = func(sourceFile *ast.SourceFile) []ConfiguredRule
Click to show internal directories.
Click to hide internal directories.