katas

package
v0.1.62 Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2025 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultKatasRegistry = NewKatasRegistry()

DefaultKatasRegistry is the default registry.

Registry is the global registry.

Functions

func RegisterKata

func RegisterKata(nodeType ast.Node, kata Kata)

RegisterKata registers a new Kata with the default registry.

Types

type Kata

type Kata struct {
	ID          string
	Title       string
	Description string
	Severity    Severity
	Check       func(node ast.Node) []Violation
}

Kata represents a single linting rule.

type KatasRegistry added in v0.0.4

type KatasRegistry struct {
	KatasByType map[string][]Kata
	KatasByID   map[string]Kata
}

KatasRegistry is a registry for all available Katas.

func NewKatasRegistry added in v0.1.1

func NewKatasRegistry() *KatasRegistry

NewKatasRegistry creates a new KatasRegistry.

func (*KatasRegistry) Check added in v0.0.4

func (kr *KatasRegistry) Check(node ast.Node, disabledKatas []string) []Violation

func (*KatasRegistry) GetKata added in v0.0.4

func (kr *KatasRegistry) GetKata(id string) (Kata, bool)

GetKata returns a Kata by its ID.

func (*KatasRegistry) KatasByNodeType added in v0.0.4

func (kr *KatasRegistry) KatasByNodeType() map[string][]Kata

KatasByNodeType returns all registered Katas grouped by node type.

func (*KatasRegistry) RegisterKata added in v0.1.1

func (kr *KatasRegistry) RegisterKata(nodeType ast.Node, kata Kata)

RegisterKata registers a new Kata.

type Severity added in v0.1.25

type Severity string

Severity defines the severity of a violation.

const (
	Error   Severity = "Error"
	Warning Severity = "Warning"
	Info    Severity = "Info"
)

type Violation

type Violation struct {
	KataID  string
	Message string
	Line    int
	Column  int
	Level   Severity
}

Violation represents a found violation in the code.

Jump to

Keyboard shortcuts

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