-
-
Notifications
You must be signed in to change notification settings - Fork 18
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Description
When using (on Ubuntu 20.04)
- This repository, version 4.0.0
- pre-commit 2.9.2
- python 3.8.5
- git 2.25.1
with the commitlint hook, an error occurs when using pre-commit as a hook (but not when calling it directly).
Error
When trying to commit, the following error occurs:
❯ git commit --all --message 'feat: test commit'
commitlint...............................................................Failed
- hook id: commitlint
- exit code: 1
[Errno 8] Exec format error: '/home/morre/.cache/pre-commit/repo6j0wed15/node_env-default/bin/commitlint'
However, running pre-commit run --all-files
does not produce the same error.
Running the hook in version v.3.0.0
also does not produce this error.
Reproduction
Steps
- Create a new directory to test in and enter it
- Initialize a git repository
- Initialize a venv, activate it and install pre-commit==2.9.2
- Add a hook for commitlint
- Register pre-commit as commit-msg hook
- Try to commit and see that it fails
- Run pre-commit on all files directly and see that it works
Copy-Paste
Execute
mkdir test
cd test
git init
python3.8 -m venv venv
source venv/bin/activate
pip install pre-commit
Create .pre-commit-config.yaml
with:
default_stages: [commit]
repos:
- repo: https://github.com/alessandrojcm/commitlint-pre-commit-hook
rev: v4.0.0
hooks:
- id: commitlint
stages: [commit-msg]
additional_dependencies: ['@commitlint/config-conventional']
Execute
pre-commit install --hook-type commit-msg
git commit --all --message 'feat: test commit'
Note the error detailed above.
Jerome1337, kaveet, pafi-code and BeeHiveJava
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working