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

yamllint

Stow package for ~/.config/yamllint/config. yamllint is a YAML linter — invoked by lefthook on pre-commit, by ALE in vim, and by hand.

Table of contents

Layout

FileStows to
yamllint/.config/yamllint/config~/.config/yamllint/config

yamllint only reads this file when run without -c <path> and when the project has no .yamllint/.yamllint.yml/.yamllint.yaml of its own.

Rule tweaks

Starting from extends: default:

RuleChangeWhy
line-length: 120 (warning)bump from 80, demote to warningnobody wraps YAML at 80
document-startdisable--- is rarely useful in single-doc files
truthy.check-keys: falsedon’t flag on: keysGitHub Actions uses on: as a top-level key
comments.min-spaces-from-content: 1down from 2the default is overly strict
comments-indentationdisablemis-indented comments are common in real YAML and rarely matter
indentation.indent-sequences: consistentdon’t require nested under keymatches both common styles
braces / brackets max-spaces-inside: 1allow { k: v }flow style is fine

Per-project overrides

Drop a .yamllint in your repo root — it wins. Lefthook’s pre-commit hook (template at lefthook/lefthook.yml) will use whichever yamllint finds first.

Fresh-machine setup

brew install yamllint    # in the Brewfile
stow yamllint