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

Failed / exit code: -9 when using pre-commit >=3.4.0 and a lot of files #926

Open
MaxWinterstein opened this issue Feb 6, 2024 · 2 comments

Comments

@MaxWinterstein
Copy link

MaxWinterstein commented Feb 6, 2024

After updating pre-commit to a version >=3.4.0 the typos hook starts to fail for us. Issue seems to behave different on amd64 vs aarch64, but can be reproduced stable with these simple script that just creates 30.000 files, each within its own folder:

test.sh

!#/bin/bash

cd tmp

for i in {1..30000}; do tdir="$(mktemp -d ./foo.XXXXXXXXX)" ;tfile="$(mktemp $tdir/foo.XXXXXXXXX.json)"; echo foo > $tfile; echo $i ; done

cat << EOF > .pre-commit-config.yaml
repos:
  - repo: https://github.com/crate-ci/typos
    rev: v1.18.0
    hooks:
      # Hook does not autofix on purpose. Better safe than sorry.
      - id: typos
        args: [--no-check-filenames]
EOF

git init
git add -A

echo '################################ run with pre-commit==3.6.0'
pip install -q pre-commit==3.6.0
pre-commit run --all-files typos

echo '################################ run with pre-commit==3.3.3'
pip install -q pre-commit==3.3.3
pre-commit run --all-files typos

I just ran it in a docker container to keep stuff clean:

docker run --rm -ti -v $PWD/test.sh:/tmp/test.sh --entrypoint=/bin/bash python:3.11.7

(compressed) result:

################################ run with pre-commit==3.6.0
typos....................................................................Failed
- hook id: typos
- exit code: -9
- 
################################ run with pre-commit==3.3.3
typos....................................................................Passed

There was some change towards negative signals introduced with 3.4.0, see pre-commit/pre-commit#2970.

I guess, typos ran by pre-commit can't handle a lot of files and "dies", which it may have done before, but without any visible signs.

@epage
Copy link
Collaborator

epage commented Feb 6, 2024

Running typos directly,. I am not able to reproduce this.

@MaxWinterstein
Copy link
Author

Running typos directly,. I am not able to reproduce this.

Can confirm that. Happens only when using pre-commit

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

No branches or pull requests

2 participants