typicode / husky

Git hooks made easy 🐶 woof!
https://typicode.github.io/husky
MIT License
31.69k stars 996 forks source link

Integrating with `pre-commit.com` #1391

Closed LecrisUT closed 2 months ago

LecrisUT commented 3 months ago

I thought there was already an issue about this, but I can't find it, so I am creating one again.

The issue over here is how to satisfy both workflows? pre-commit.com is generally more robust in how it selects the pre-commits run and how it is customizable on the pre-commit, pre-push etc. But than husky is more manageable in that it can run simple shell scripts, the main use-case I have is to check github action dist folder.

One suggestion is to make husky executable as .pre-commit-hooks.yaml. Pre-commit already supports node environments, something like:

-   id: husky
    name: Husky pre-commit
    description: Run husky defined pre-commits
    entry: husky
    language: node
typicode commented 2 months ago

Hi thanks for sharing this idea :)

I'm not sure how :thinking: ? Also I feel it would be redundant.

LecrisUT commented 2 months ago

Also I feel it would be redundant.

Not really. Currently husky overrides the pre-commit hook in .git, so pre-commit.com is never run, thus the user is missing style checks