fix: let the pre-commit hook handle generated-only commits - #37
Merged
Conversation
The Generate SDK workflow reached the commit step for the first time since
the codegen was repaired, and died there:
oxlint --fix
No files found to lint. Please check your paths and ignore patterns.
husky - pre-commit script failed (code 1)
lint-staged hands oxlint the 5 staged files, all under src/client/, which
.oxlintrc.json lists in ignorePatterns. oxlint filters every path out and
then exits 1 on the empty set, so any commit touching only the generated
client is impossible — which is exactly the shape of every SDK-update
commit. Latent since the eslint -> oxlint move; unreachable until the
codegen ran again.
--no-error-on-unmatched-pattern makes the empty set a no-op. Verified it
does not mask real findings: a file with an unused variable still exits 1,
and 'pnpm run lint' (oxlint src test) keeps the strict behaviour for CI.
Codecov Report✅ All modified and coverable lines are covered by tests. @@ Coverage Diff @@
## master #37 +/- ##
=======================================
Coverage 90.75% 90.75%
=======================================
Files 1 1
Lines 119 119
Branches 30 30
=======================================
Hits 108 108
Misses 11 11 🚀 New features to boost your workflow:
|
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.
With the codegen repaired (#36), the Generate SDK workflow got past generate/build/test for the first time since 2026-08-27 — and died one step later, at the commit:
Cause
lint-stagedhandsoxlintthe staged*.tsfiles. On an SDK-update commit those are exactly the 5 regenerated files undersrc/client/, which.oxlintrc.jsonlists inignorePatterns. oxlint filters all of them out and then exits 1 on the empty set.So any commit touching only the generated client is impossible — which is the shape of every single SDK-update commit. Latent since the eslint → oxlint migration (0443560); unreachable until the codegen started running again, so it surfaced only now.
Fix
--no-error-on-unmatched-patternturns the empty set into a no-op.Checked that it does not buy the green cheaply:
src/client/sdk.gen.ts)src/)pnpm run lint(oxlint src test)Reproduced the full failure locally before and after: regenerate from the live 1.114.0 spec, stage
src/client+public-openapi.json, runpnpm lint-staged. Fails onmaster, passes here.Note
Low Risk
Tooling-only change to lint-staged; does not alter application logic or how full-repo lint runs.
Overview
Adds
--no-error-on-unmatched-patternto theoxlint --fixstep in.lintstagedrc.json.On SDK/codegen commits, lint-staged only stages regenerated files under
src/client/, which.oxlintrc.jsonalready ignores. oxlint then linted nothing and exited 1, so husky blocked commits that touch only generated client output.With the flag, an empty matched set is a no-op (exit 0); real issues elsewhere and
pnpm run lintbehavior are unchanged.Reviewed by Cursor Bugbot for commit a5a04bd. Bugbot is set up for automated code reviews on this repo. Configure here.