Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions bash/tests/test-lint-yamllint-config.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,9 @@
# comments-indentation=warning, octal-values=disabled.
#
# Unlike the markdownlint wrapper, this does NOT merge configs: yamllint's -c
# loads a single file, and CI (run-standards.sh:147-150) is likewise
# either/or. The assertions below encode that difference deliberately.
# loads a single file, and CI (the yamllint config block in
# run-standards.sh) is likewise either/or. The assertions below encode that
# difference deliberately.
set -uo pipefail
unset CDPATH

Expand Down Expand Up @@ -103,7 +104,7 @@ fi

# ---------------------------------------------------------------------
# Case 2: repo config present. It must WIN over the canonical file, matching
# run-standards.sh:147-150. Asserted with a repo config that is deliberately
# CI's yamllint block. Asserted with a repo config that is deliberately
# stricter than canonical — if the canonical were used instead, the finding
# would not fire and this would silently pass.
# ---------------------------------------------------------------------
Expand Down
9 changes: 5 additions & 4 deletions git/hooks/lint-yamllint.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
#!/usr/bin/env bash
# YAML lint wrapper for the `yamllint` pre-commit hook.
#
# Resolves the config the way CI does (standards/run-standards.sh:147-150):
# Resolves the config the way CI does. The upstream original is the yamllint
# config block in standards/run-standards.sh, whose resolution loop reads:
#
# cfg=""
# for c in .yamllint .yamllint.yml .yamllint.yaml; do
Expand All @@ -27,9 +28,9 @@
# rather than letting yamllint choose.
#
# UNLIKE the markdownlint wrapper next door, this does NOT merge configs.
# yamllint's -c takes a single file, and CI's own resolution at
# run-standards.sh:147-150 is likewise either/or: the first repo-local name
# that exists wins outright, and the canonical file is used only when none do.
# yamllint's -c takes a single file, and CI's own resolution in that same
# block is likewise either/or: the first repo-local name that exists wins
# outright, and the canonical file is used only when none do.
# An earlier handoff speculated this "may legitimately be a merge because
# yamllint has `extends:` semantics". It is not. `extends:` is a directive
# *inside* a config file, resolved by yamllint itself; it is not config
Expand Down
11 changes: 6 additions & 5 deletions pre-commit/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,9 @@ repos:
# on any machine without dotfiles installed — stricter than the fleet's
# `relaxed` base, blocking on `line-length` (error at 80 vs warning at
# 120) and `indentation` (error vs warning), so local and CI disagreed
# by construction. The wrapper resolves the config exactly as
# run-standards.sh:157-161 does. See twistedmelonman/claude-config#532.
# by construction. The wrapper resolves the config exactly as the
# yamllint block in run-standards.sh does. See
# twistedmelonman/claude-config#532.
- id: yamllint
name: "YAML Lint (yamllint)"
entry: bash -c '$HOME/.config/git/hooks/lint-yamllint.sh "$@"' --
Expand Down Expand Up @@ -149,9 +150,9 @@ repos:
# twistedmelonman/claude-config#533.
#
# lint-markdown.sh merges the two instead: canonical policy as the base,
# repo keys layered on top. That matches how CI resolves config
# (github-workflows standards/run-standards.sh:193-197), so the local gate
# and standards-check agree on the rules.
# repo keys layered on top. That matches how CI resolves config (the
# markdownlint block in github-workflows standards/run-standards.sh), so
# the local gate and standards-check agree on the rules.
- repo: local
hooks:
- id: markdownlint
Expand Down
Loading