-
-
Notifications
You must be signed in to change notification settings - Fork 419
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
precommit runs twice when using commitizen #152
Comments
If you always commit using Regarding running twice: it should not. Looking at your config I can't see the reason for that. So you should investigate and create a reproducible example on GitHub if the problem is with this package. |
I have same issue here |
ha! so this isn't definitely issue with this library, rather than husky is the culprit here. I guess you can close this @okonet Maybe it should be stated in your docs? If you're ok with that I'll submit PR thanks! |
for more details pls see lint-staged/lint-staged#152
for more details pls see lint-staged/lint-staged#152
PR would be awesome! Thanks for investigating. |
cheers ! #182 |
Is there an issue in the husky repository to fix this? |
this is fixed with latest husky ✌️
"scripts": {
-"cz": "git-cz",
+"commit": "git-cz",
-"precommit": "lint-staged"
},
+"husky": {
+ "hooks": {
+ "pre-commit": "lint-staged"
+ }
+ } |
humm so @Hotell juts to confirm steps to get this working:
is all you need? Because when I run |
@wearefridayhutber I get the same. My approach has been to simply run a specific script before husky.
The Or
This approach ensures that husky is run before commitizen (but not after) and before a vanilla |
This seems to be happening again with |
I'm using Husky. I have:
At first I thought perhaps the
precommit
script isn't needed anymore, so I remove the it andlint-staged
doesn't run at all. Then I decided to commit withoutcommitizen
and realized that's where the problem is.lint-staged
is called once before thecommitizen
command line form appears, and again after you submit it. Is that the expected behavior? What can be done about it?The text was updated successfully, but these errors were encountered: