Bug in flake8 git pre-commit hook?
Hey guys, Try and do the following: ```bash mkdir test && cd test git init flake8 --install-hook git git config --bool flake8.strict true echo a= 2 > foo.py && git add foo.py git commit -m "This is bad!" ``` This commit is accepted! It shouldn't be. Note that if you instead do ```bash mkdir test2 && cd test2 git init flake8 --install-hook git git config --bool flake8.strict true echo a= 2 > foo.py && git add foo.py git commit -m "Add a foo file" echo b =3 > foo.py && git add foo.py git commit -m "This is bad!" ``` then the first commit is wrongly accepted, but the second commit (and any following) is correctly rejected. My best guess: this has to do with `copy_indexed_files_to` in the line ```python filepaths = list(copy_indexed_files_to(tempdir, lazy)) ``` inside of the definition of `hook` from flake8.main.git Curious to know your thoughts! Cheers, Mattia
participants (1)
-
Mattia Ciollaro