linter

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2025 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package linter provides a linter.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Linter

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

Linter represents the main linter.

func New

func New(outFile io.Writer) *Linter

New creates a new linter instance with default rules.

func (*Linter) HasIssues

func (l *Linter) HasIssues() bool

HasIssues returns true if there are any issues.

func (*Linter) Lint

func (l *Linter) Lint(node ast.ExprNode)

Lint analyzes the given AST and returns a list of issues.

func (*Linter) PrintIssues

func (l *Linter) PrintIssues(filename string)

PrintIssues prints all issues found by the linter.

type Rule

type Rule interface {
	// Name returns the name of the rule.
	Name() string
	// Description returns a description of what the rule checks.
	Description() string
	// Analyze analyzes the given AST node and returns any issues found.
	Analyze(node ast.ExprNode)
}

Rule represents a linting rule that can analyze AST nodes.

Directories

Path Synopsis
Package reporter provides a reporter for linting issues.
Package reporter provides a reporter for linting issues.
Package rules provides the rules for the linter.
Package rules provides the rules for the linter.

Jump to

Keyboard shortcuts

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