Skip to content

feat: replace pre-commit with husky (#163)#164

Open
itziarZG wants to merge 1 commit intomainfrom
develop
Open

feat: replace pre-commit with husky (#163)#164
itziarZG wants to merge 1 commit intomainfrom
develop

Conversation

@itziarZG
Copy link
Copy Markdown
Collaborator

@itziarZG itziarZG commented Apr 7, 2026

Replace pre-commit with husky + lint-staged + commitlint

Why

pre-commit requires Python, which is an unnecessary dependency for a pure Node.js/Astro project. husky is the standard for git hooks in the JS ecosystem and integrates natively with pnpm.

Changes

  • Removed .pre-commit-config.yaml
  • Added husky, lint-staged, @commitlint/cli, @commitlint/config-conventional
  • .husky/pre-commit: runs astro check + prettier --check (via lint-staged, only on staged files)
  • .husky/commit-msg: validates conventional commits via commitlint
  • Updated README: removed Python/pre-commit from requirements

Same checks, same behavior

Before (pre-commit) After (husky)
astro check on commit astro check on commit

After merging

  • Contributors only need pnpm install — hooks are configured automatically via the prepare script.
  • Python and the env/ virtualenv are no longer needed. Each contributor can delete their local env/ directory.

## Replace pre-commit with husky + lint-staged + commitlint

### Why

pre-commit requires Python, which is an unnecessary dependency for a
pure Node.js/Astro project. husky is the standard for git hooks in the
JS ecosystem and integrates natively with pnpm.

### Changes

- Removed `.pre-commit-config.yaml`
- Added `husky`, `lint-staged`, `@commitlint/cli`,
`@commitlint/config-conventional`
- `.husky/pre-commit`: runs `astro check` + `prettier --check` (via
lint-staged, only on staged files)
- `.husky/commit-msg`: validates conventional commits via commitlint
- Updated README: removed Python/pre-commit from requirements

### Same checks, same behavior

| Before (pre-commit) | After (husky) |
|---|---|
| `astro check` on commit | `astro check` on commit |
| `prettier --check` on commit | `prettier --check` on staged files |
| conventional-pre-commit | @commitlint/config-conventional |

### After merging

- Contributors only need `pnpm install` — hooks are configured
automatically via the `prepare` script.
- Python and the `env/` virtualenv are no longer needed. Each
contributor can delete their local `env/` directory.
@itziarZG itziarZG requested a review from francescarpi April 7, 2026 09:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants