Skip to content

fix(length): close three length-cap gaps from #383 - #452

Merged
twistedmelonman merged 2 commits into
mainfrom
claude/fix-383-length-cap-minors
Oct 21, 2026
Merged

twistedmelonman merged 2 commits into
mainfrom
claude/fix-383-length-cap-minors

Conversation

@twistedmelonman

Copy link
Copy Markdown
Member

Works through the deferred minor findings in #383.

Fixed

  • All-files exemption spellings. lint-length.sh refused only the literal *, ** and **/*. /**, **/**, /**/*, **/**/* and *** also exempt every file and passed. The hook now asks git: a length-caps=off pattern is refused when check-attr matches it to three probe paths (top level, dotfile, nested) that share no characters. The string normalization the issue suggested was not used, because it would refuse /* (top level only) and miss ***. /*, */**, /vendor/**, *9* and *z* stay allowed.
  • Run from a subdirectory. The hook now cds to the repository top. Before, git ls-files missed the root .gitattributes, and check-attr --stdin read the diff's top-relative paths as cwd-relative, so a root /lib.py length-caps=off was also lost.
  • Rollout. ~/.config/pre-commit/config.yaml is a symlink into the repo, so a pull changes it at once. lint-length.sh is linked only by install.sh --sync, and symlink repair skips missing links. The entry now fails closed with a message naming install.sh --sync and SKIP=length-caps. Before, it exited 127 with bash's bare "No such file".

Already resolved

Not done (needs a decision)

  • The gh wrapper still picks its block headline by matching gate-review's reason text. A stable signal needs a gate-review.sh check change in claude-config.
  • pre-commit/README.md still lists only *, **, **/*. Its update is copy-gated and waits for approval.

Tests

  • bash/tests/test-lint-length.sh: new refusal, allow and subdirectory cases. They failed on the old hook first.
  • bash/tests/test-length-caps-entry.sh (new): reads the real entry from config.yaml, splits it with shlex as pre-commit does, and runs it with no linked script and with a linked one.

Advances #383

Claude Code Bot added 2 commits October 20, 2026 16:33
…d entry

Three of the deferred minor findings from the length-caps review:

- lint-length.sh refused only the literal patterns `*`, `**` and `**/*`.
  `/**`, `**/**`, `/**/*` and `***` also exempt every file. It now asks
  git: a pattern is refused when check-attr matches it to a top-level
  file, a dotfile and a nested file. `/*` (top level only) and `*/**`
  stay allowed, which a string normalizer would have got wrong.
- Run by hand from a subdirectory, the hook missed the root
  .gitattributes and passed top-relative paths to check-attr as if they
  were cwd-relative, so a root `/lib.py length-caps=off` was lost. It
  now cd's to the repository top first.
- pre-commit/config.yaml is a symlink into this repo, so a pull changes
  it at once, while lint-length.sh is linked only by install.sh --sync.
  The entry now fails closed with a message naming install.sh --sync and
  SKIP=length-caps instead of bash's bare "No such file" (exit 127).

The gh api `-X POST` cap-kind item was already fixed by #442. The block
headline still keys on gate-review's reason text; a stable signal needs
a gate-review.sh change in claude-config, left for a decision.
pre-commit/README.md still lists only `*`, `**` and `**/*`; its update
is copy-gated and waits for approval.

Advances #383
The three probe paths shared characters, so `*9*` or `*z*` matched all
three and was refused as exempting every file. The probes now share no
character (zq9, .AB, x/y/k_7); tests pin `*9*` and `*z*` as allowed.

Found by the commit-time code reviewer.

Advances #383
@twistedmelonman
twistedmelonman merged commit 7569653 into main Oct 21, 2026
5 checks passed
@twistedmelonman
twistedmelonman deleted the claude/fix-383-length-cap-minors branch October 21, 2026 01:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant