Skip to content
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

Missing usage examples #415

Open
FelixZY opened this issue Feb 7, 2025 · 1 comment
Open

Missing usage examples #415

FelixZY opened this issue Feb 7, 2025 · 1 comment
Labels
bug Something isn't working

Comments

@FelixZY
Copy link

FelixZY commented Feb 7, 2025

I'm missing actual usage examples. I've been able to figure some things out via the --help flag but would love to see a commit-msg hook example at minimum.

@FelixZY FelixZY added the bug Something isn't working label Feb 7, 2025
@FelixZY
Copy link
Author

FelixZY commented Feb 8, 2025

Here's the commit-msg hook I set up:

#!/usr/bin/env sh

commitlint --edit "$1" || (printf "Your commit message was:\n\n%s\n" "$(cat "$1")" && exit 1)

A benefit of this hook is that it prints your commit message if linting fails. Not printing the commit message on lint failure has caused colleagues of mine to disable the linter in the past as they "lost" their message.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant