refactor(pre-commit): drop the tool-owned round-trip test for #102
The apm-audit-ci pre-push hook already fails when pretty-format-json sorts apm-owned JSON, so a dedicated test only improved the diagnosis while adding ~100 lines of bash and a pre-commit cache dependency. Remove the test and the comment, gates.md and LESSONS.md text that pointed at it; the --no-sort-keys fix itself is unchanged. Refs: #102 Co-Authored-By: Claude Code <[email protected]> Claude-Session: https://claude.ai/code/session_01KkT7RSDwDbmrM9T34b6sTi
This commit is contained in:
1 parent
c2c56ff948
commit
18fbdbc8e4
4 files changed
+8
-130
No files matched your search
+5
-8
@@ -1289,18 +1289,15 @@ the default, the formatter rewrites apm's output into a form apm would never pro
|
||||
|
||||
The hook now passes `--no-sort-keys`, so this file and its committed `.claude/apm-hooks.json` sidecar
|
||||
(apm output under the same byte-for-byte replay) need **no exclude**: the formatter's default 2-space
|
||||
indent already matches apm's, and with insertion order kept they round-trip untouched.
|
||||
`tests/test-pretty-json-tool-owned.sh` runs the repo's real `pretty-format-json`, `end-of-file-fixer`
|
||||
and `trailing-whitespace` over copies of the four tracked apm-owned files (these two,
|
||||
`.claude-plugin/marketplace.json` and `apm.lock.yaml`) and fails if any is rewritten, so dropping
|
||||
`--no-sort-keys` — or an apm change that makes another autofixer touch its output — fails a test
|
||||
instead of surfacing as drift on an unchanged file.
|
||||
indent already matches apm's, and with insertion order kept they round-trip untouched. No dedicated
|
||||
test pins this: dropping `--no-sort-keys` surfaces at pre-push as `apm-audit-ci` drift on
|
||||
`.claude/settings.json`, which is the same gate that caught the original failure.
|
||||
|
||||
**Load-bearing. Do not remove `--no-sort-keys`.** `.claude-plugin/marketplace.json` is the one path
|
||||
still in that hook's `exclude:`: it carries literal em dashes that the formatter re-escapes to
|
||||
`\u2014`, which `--no-ensure-ascii` would stop but for every JSON file. This closes the JSON case
|
||||
only; a new tool-owned file in the scope of another autofixer is still caught only by that test,
|
||||
not by a derived gate.
|
||||
only; a new tool-owned file in the scope of another autofixer is still caught only by `apm-audit-ci`
|
||||
drift after the fact, not by a derived gate.
|
||||
|
||||
## Pushing without a network
|
||||
|
||||
|
||||
Reference in new issue
Block a user