pre-commit / pre-commit-hooks

Some out-of-the-box hooks for pre-commit
MIT License
5.2k stars 694 forks source link

check-added-large-files doesn't work with repo: local #1006

Closed ISPritchin closed 8 months ago

ISPritchin commented 8 months ago

Hi! Thanks for your development!

For certain reasons I use repo:local. Some precommits are processed correctly. However, check-added-large-files throws an IndexError that occurs in check_added_large_files.py. Instead of a list of strings of length divisible by 3, in the stdout variable I got a list containing exactly one string.

I was able to fix it manually in a couple of minutes. But I would like the authors to make the correction themselves (to keep the code consistent).

Very briefly, the fix was to split that stdout-string by the characters "'\n", ":".

A similar error is described here: https://github.com/pre-commit/pre-commit-hooks/issues/718

asottile commented 8 months ago

without a reproduction or any information I can't help you