Skip to content

chore: add pre-commit formatting with Lefthook - #34

Merged
ho991217 merged 2 commits into
mainfrom
chore/introduce-lefthook
Oct 4, 2026
Merged

ho991217 merged 2 commits into
mainfrom
chore/introduce-lefthook

Conversation

@ho991217

@ho991217 ho991217 commented Oct 4, 2026

Copy link
Copy Markdown
Collaborator

Automatically format staged JavaScript, TypeScript, and JSON files with Prettier before committing and stage the fixes.

Pin Lefthook to 2.1.16 through mise and register Git hooks after mise install.

Verified root and nested file formatting, partial-staging recovery, and hook installation with fresh and cached mise installs.

@ho991217
ho991217 requested a lite review from Copilot October 4, 2026 08:21
@ho991217 ho991217 self-assigned this Oct 4, 2026
@ho991217 ho991217 added the enhancement New feature or request label Oct 4, 2026

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟡 Changes recommended

The hook glob does not cover all supported JavaScript and TypeScript extensions.

Review effort: Lite
Findings: 1 Medium severity

Open (1)
What changed in this PR

Adds mise-managed Lefthook installation and Prettier formatting for staged files.

Changes:

  • Pins Lefthook and registers hooks via mise.
  • Adds the generated lockfile.
  • Configures staged JavaScript, TypeScript, and JSON formatting.
File Description
mise.toml Configures Lefthook and automatic hook installation.
mise.lock Locks Lefthook and related tool versions.
lefthook.yml Defines the staged-file Prettier hook.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread lefthook.yml Outdated
@ho991217
ho991217 merged commit 60f4598 into main Oct 4, 2026
1 check passed
@ho991217
ho991217 deleted the chore/introduce-lefthook branch October 4, 2026 08:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants