Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

carapace-lint

A golangci-lint plugin enforcing carapace command definition conventions. The plugin is built into a custom golangci-lint binary using .custom-gcl.yml and configured in .golangci.yml.

golangci-lint custom      # build custom-gcl from .custom-gcl.yml
./custom-gcl run ./...    # lint
./custom-gcl run --fix ./... # lint with auto-fixes

Analyzers

SettingDescription
flags-orderflags defined with cmd.Flags().<Type>(...) have to be alphabetically ordered
flag-actions-orderentries of FlagCompletion(carapace.ActionMap{...}) have to be alphabetically ordered
macro-syntaxexported actions under pkg/actions/ have to match the macro syntax
completion-valuescompletion values have to be paired correctly and must be unique

All checks are enabled by default. Ordering and duplicate-entry findings support auto-fix with --fix.