-
Notifications
You must be signed in to change notification settings - Fork 931
fix: works on Windows? #3555
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
Comments
Can you try if this works in your project? Just mto make sure commitlint and the config in general are working: echo "feat: with husky" | npx commitlint Looks like somehow husky is using a previous commit instead of your current one. Maybe huskys config is not correct.
|
Yes that command does not give any errors and runs and terminates without an issue (it doesn't print anything too, I don't know if this is what you expected?). However, for some reasons, creating separate So this is the working state:
And this is the bad state:
|
@aderchox nice! Do we need to adjust the docs (...again)? |
Honestly, I don't know. I'm pretty new to using husky and commitlint and I don't know what changes you've made to the docs in the past (talking of your "...again" lol). If you think other newcomers to this package might make the same mistake, I think a notice could be helpful. Or otherwise just ignore it and let's hope the curious will search issues and will find this issue here. :) |
If you like you can create a PR with a notice to the README. Apart from that I guess you could close this for now. |
Uh oh!
There was an error while loading. Please reload this page.
Expected Behavior
Hi, I'm new to Husky and Commitlint, I've learned about these in a tutorial, but the tutor is using Zsh and I'm using Pwsh7 on Windows. I wonder if it's supposed to work in my case?
When I want to make a commit, e.g.,
git commit -m "feat: with husky"
I get an error about my previous (the first one) commit:Even if I do
git commit --amend
to change the commit message of the last commit to conventional style, I get the exact same error as above.Current Behavior
I expect my commit message
"feat: with husky"
to be accepted.Affected packages
Possible Solution
No response
Steps to Reproduce
Here are the steps I've taken:
0.
pnpm dlx husky-init && pnpm install
pnpm add @commitlint/cli @commitlint/config-conventional
npm test
) :npx --no -- commitlint --edit $1
commitlint.config.js
and add this in it:module.exports = {extends: ['@commitlint/config-conventional']}
git commit -m "feat: with husky"
// gives the error I explained earlierContext
I'm trying to lint my commit messages and I'm using Powershell7 on Windows, I see that Husky's documentation says Windows is supported, but I'm not sure about commitlint, and if I can use it in my case (also I don't know if it's worth mentioning, but I'm using pnpm, but I guess it must not be related to this issue).
commitlint --version
@commitlint/[email protected]
git --version
git version 2.37.0.windows.1
node --version
v18.12.1
The text was updated successfully, but these errors were encountered: