ci: check formatting in the lint job - #35
Merged
Merged
Conversation
The lint job ran eslint and tsc but never `npm run format:check`, so nothing
enforced the Prettier config the repo already ships. The serve module reached
main unformatted as a result, and was only reformatted when v0.7.0 was cut.
Add the check as the last step of the lint job. Last rather than first because
a failing step stops the job, and a whitespace nit should not hide a real lint
or type error.
Note this covers `src/**/*.{ts,tsx,json,md}`, which is what the existing
`format` and `format:check` scripts target — README.md and USAGE.md sit at the
repo root and remain unchecked.
Signed-off-by: Steven Borrelli <steve@borrelli.org>
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.
Follow-up to #34.
The
lintjob runsnpm run lintandnpm run typecheck, but nevernpm run format:check— so nothing enforced the Prettier config the repo already ships. That is how the serve module (#32) reached main unformatted; it was only noticed and fixed when v0.7.0 was cut.The change
One step added to the
lintjob:It goes last deliberately. A failing step stops the job, so putting the formatting check first would mean a stray space masks a genuine lint or type error until someone fixes the whitespace and pushes again.
No new job, so no change to what
publishwaits on — it already needslint.Verification
npm run format:checkpasses onmainas it stands, so this does not land redsrc/serve/serve.tsit exits 1, and 0 once revertedlintjob's steps resolve to Checkout → Install →npm ci→ Lint → Typecheck → FormatOne gap this does not close
formatandformat:checkboth targetsrc/**/*.{ts,tsx,json,md}.README.mdandUSAGE.mdlive at the repo root and stay unchecked. Widening the glob would reformat both files in one go, which felt like it belonged in its own PR rather than riding along with a CI fix — happy to do that separately if you want the docs covered too.