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

automatic commit message linting #412

Merged
merged 6 commits into from
Oct 3, 2023
Merged

automatic commit message linting #412

merged 6 commits into from
Oct 3, 2023

Conversation

goerlibe
Copy link
Collaborator

@goerlibe goerlibe commented Sep 28, 2023

EDIT: it works now, please test it :)

after 10 minutes of trying to install commitlint without success, I decided to simply go back to your script, but enable it in the pre-commit checks as well. commitlint would be much nicer though...

you might need to run pre-commit install --hook-type commit-msg to enable it. Future installations should do this automatically.

@goerlibe goerlibe marked this pull request as ready for review September 28, 2023 09:12
@lukasrothenberger
Copy link
Collaborator

Following a setup using pre-commit install --hook-type commit-msg, i run into the following error

Check commit message with commitlint.....................................Failed
- hook id: commitlint
- exit code: 1

/home/lukas/.cache/pre-commit/repo3pebvguf/node_env-system/lib/node_modules/commitlint-pre-commit-hook/node_modules/cosmiconfig/dist/index.js:78
    if (metaConfig.config?.loaders) {
                          ^

SyntaxError: Unexpected token '.'
    at wrapSafe (internal/modules/cjs/loader.js:915:16)
    at Module._compile (internal/modules/cjs/loader.js:963:27)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)
    at Module.load (internal/modules/cjs/loader.js:863:32)
    at Function.Module._load (internal/modules/cjs/loader.js:708:14)
    at Module.require (internal/modules/cjs/loader.js:887:19)
    at require (internal/modules/cjs/helpers.js:74:18)
    at Object.<anonymous> (/home/lukas/.cache/pre-commit/repo3pebvguf/node_env-system/lib/node_modules/commitlint-pre-commit-hook/node_modules/@commitlint/load/lib/utils/load-config.js:7:23)
    at Module._compile (internal/modules/cjs/loader.js:999:30)
    at Object.Modul

@goerlibe
Copy link
Collaborator Author

I removed commitlint for now -- but running pre-commit install should enable the custom script to run when committing

@goerlibe goerlibe merged commit dc10146 into master Oct 3, 2023
3 checks passed
@goerlibe goerlibe deleted the commitlint branch October 3, 2023 09:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants