commitizen / commitizen/cz-cli
Update Documentation for pre-commit hooks with Husky 5
- Lenguaje dominante
- JavaScript
- Estrellas
- 17.5k
- Forks
- 566
- Merge medio
- 8 h 16 min
- PR fusionados (30 d)
- 1
Descripción
Hi commitizeners :)
I love using commitizen on my projects, and with husky hooks for pre-commit is great.
BUT... There is a new version of Husky, (Husky 5) which breaks how hooks are set up. That means the commitizen documentation is now out of date (because it only describes from Husky 4).
## PROBLEM:
The commitizen documentation is out of date for Husky 5.
## Main Differences:
In Husky 4, you add a husky hook to package.json and install commitizen and husky. Husky automatically registers the hook.
Now... in Husky 5, the hooks are added to separate files (NOT package.json)
## SOLUTION:
Brief instructions follow, which I suggest to be added to the commitizen documentation.
#### Using Commitizen with Husky 5
Install husky:
npm install--save-dev husky
Then run this to add a pre commit message hook:
npx husky add .husky/prepare-commit-msg "exec < /dev/tty && git cz --hook || true"
Note, you will probably want to add the resulting hook file to git:
.husky/prepare-commit-msg
UPDATE: If your hooks don't run, you can tell Husky to install them:
npx husky install
Hope that is helpful!
Guía de contribución
Línea de trabajo
Localiza la sección existente de la documentación de commitizen que describe Husky 4 y compárala con las instrucciones para Husky 5 de este issue, incluidos .husky/prepare-commit-msg y la configuración del paquete. Actualiza la documentación para cubrir el nuevo flujo de trabajo basado en archivos de hook y el comando de instalación; después, verifica que las instrucciones sean correctas.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- git, javascript
- Área
- cli, documentation
- Tipo de issue
- Documentación
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Estado de actividad
- Estancado
- Claridad
- Bastante claro
- Aptitud para principiantes
- 38/100