Skip to content

[Errno 8] Exec format error when commiting in version 4.0.0 #20

@morremeyer

Description

@morremeyer

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

  1. Create a new directory to test in and enter it
  2. Initialize a git repository
  3. Initialize a venv, activate it and install pre-commit==2.9.2
  4. Add a hook for commitlint
  5. Register pre-commit as commit-msg hook
  6. Try to commit and see that it fails
  7. 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.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions