generated from alex/base-template
Fix format, add lefthook pre-push check #19
Labels
No labels
dependencies
No milestone
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
alex/irc-greeter-bot#19
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Currently build fails because of formatting issues.
Fix the problem and add lefthook config so to prvent pushing changes (locally) that were not validated fully
/pi new pr
The CI runs
deno fmt --check,deno lint,deno check, anddeno test. The issue mentions formatting issues. Let me check the current formatting state and the issue/PR context.There are 2 files with formatting issues:src/mutex.ts(missing trailing newline) andREADME.md(prose reflow). Let me look at the context and the mutex.ts file (the most recent commit).Now I understand both issues. Let me see the full fmt diff to understand all changes needed:The formatting is now fixed. Let me verify all CI checks pass:All checks pass now: fmt OK, lint clean, check OK, 243 tests passing. Now let me look at existing config to build the lefthook config properly:Let me check the README for a contributing/development section where I should document the lefthook setup:I now have a complete picture. Let me create the lefthook config mirroring the CI validation steps, and document it in the README.Now let me add documentation in the README's Development section:Now let me add a "Git hooks" subsection after the deno tasks table:Let me verify everything still passes fmt (since I edited the README), and re-run all checks:Let me run fmt to auto-fix the README prose I added:Everything looks good. Let me do a final full validation and verify the lefthook config is valid YAML:The YAML is valid and all static checks pass. Let me run the test suite once more, and refine the lefthook config — I'll remove thetagsfield to keep it minimal and ensure every push runs the full validation (tags would allow bypassing checks, which slightly contradicts "validated fully"):All checks pass (fmt, lint, check, 243 tests). Let me do a final review of the complete changeset before creating the PR:I noticedeno.lockgot modified (from my YAML validation importing@std/yaml, which isn't a project dependency). Let me revert that to keep the PR clean:Now the changeset is clean: formatting fix (mutex.tstrailing newline +README.mdreflow), the newlefthook.yml, and README docs. Let me create the PR:PR #20 created: #20What was done:
Fixed the failing build — CI's
deno fmt --checkwas flagging two files:src/mutex.tshad no trailing newline (the code file that broke the build).README.mdhad a few prose lines over the 80-column wrap width, whichdeno fmtreflowed.Added Lefthook
pre-pushhook (lefthook.yml) running the same checks CI enforces —deno fmt --check,deno lint,deno check src/main.ts, anddeno test. They run in parallel; if any fails the push is aborted, so broken changes can't be pushed locally. Documented it in the README (new "Git hooks" section, activate withlefthook install).All CI steps pass locally (fmt: 43 files OK, lint clean, check OK, 243 tests passing). I left the Fallow dead-code analysis out of the hook since it's a heavy Node/npx tool; it remains the separate
deno task fallowstep.View action run | Model: zai/glm-5.2 (thinking: max) | Time: 3m 49s | Tokens: 449.6K | Pi SDK v0.82.1 | Action v2.27.0