Exclude synced static/api*.json from whitespace pre-commit hooks#3628
Merged
matthewhelmke merged 1 commit intoJul 23, 2026
Conversation
The AutoDocs job syncs OpenAPI specs (static/api*.json) verbatim from cloud storage via .github/actions/integrate-platform-docs, and the generator emits them without a trailing newline. When a sync changes those files, they enter the pre-commit diff and end-of-file-fixer rewrites them, failing the required pre-commit check on an otherwise-mergeable automated PR (e.g. chainguard-dev#3626). Exclude static/api*.json from trailing-whitespace and end-of-file-fixer, mirroring the existing chainctl-docs exclusion: both are generated, synced verbatim, and any fix the hooks apply is clobbered on the next sync. Switch each exclude to a verbose regex covering both paths. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
✅ Deploy Preview for ornate-narwhal-088216 ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Collaborator
Author
|
These files have always lacked a trailing newline and worked. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The AutoDocs PR #3626 failed the required
pre-commitcheck — a job that has always passed. The failing hook isend-of-file-fixer, on four files:These are OpenAPI specs that
.github/actions/integrate-platform-docssyncs verbatim from cloud storage (gsutil ... enforce-openapi/api*.json static/), and the generator emits them without a trailing newline. They've always lacked one; prior AutoDocs runs simply didn't change them, so they stayed out of the pre-commit diff. This run updated the spec, pulling them into the changed-file set, andend-of-file-fixerrewrote them — failing the check on content the docs team can't hand-fix (the next sync clobbers any newline we add).Fix
Exclude
static/api*.jsonfromtrailing-whitespaceandend-of-file-fixer, mirroring the existingchainctl-docsexclusion — same rationale: generated, synced verbatim, fixes don't survive the next sync. Eachexcludebecomes a verbose ((?x)) regex covering both paths.Verification
static/apidocs/x.json,static/api.json.bak) — matches only the intended specs, no over-match.pre-commit run end-of-file-fixer --files static/api*.json README.mdnow passes (the specs are skipped; normal files still checked).check-yamland the full local hook suite pass.Once this merges, the next AutoDocs run (or a rebase of #3626 onto updated
main) will pass the check.Created in collaboration with Claude Code running Opus 4.8 on 2026-07-23.