katas

package
v0.0.132 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2025 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Registry = KatasRegistry{
	KatasByNodeType: make(map[ast.NodeType][]Kata),
	KatasByID:       make(map[string]Kata),
}

Registry is the global instance of KatasRegistry that holds all registered katas.

Functions

func RegisterKata

func RegisterKata(nodeType ast.NodeType, kata Kata)

RegisterKata registers a new kata with the global registry.

Types

type Kata

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

type KatasRegistry added in v0.0.4

type KatasRegistry struct {
	KatasByNodeType map[ast.NodeType][]Kata
	KatasByID       map[string]Kata
}

func (*KatasRegistry) Check added in v0.0.4

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

Check runs all applicable katas against a given AST node.

func (*KatasRegistry) GetKata added in v0.0.4

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

GetKata retrieves a kata by its ID from the global registry.

type Violation

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

Jump to

Keyboard shortcuts

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