How to run custom shell script file before pre commit hook

Here’s what you could do to use inline bash command as pre-commit hook entry – repo: local hooks: – id: pylint-error-count name: pylint-error-count entry: bash -c ‘lines=$(pylint api/ | wc -l) && (( lines > 10)) && exit 1’ language: system types: [python] pass_filenames: false You can also write a script and invoke it this … Read more

Where does pre-commit install “environments”?

The environments are installed into a cache: pre-commit by default places its repository store in ~/.cache/pre-commit — this can be configured in two ways: PRE_COMMIT_HOME: if set, pre-commit will use that location instead. XDG_CACHE_HOME: if set, pre-commit will use $XDG_CACHE_HOME/pre-commit following the XDG Base Directory Specification. disclaimer: I am the author

Exclude some files on running black using pre-commit

This issue on the black issue tracker outlines your particular problem pre-commit finds all the python files, then applies pre-commit‘s exclusion, and then passes that list of files to the underlying tools (in this case black) black currently (at the time of writing) will format all files listed on the command line — independent of … Read more

black as pre-commit hook always fails my commits

(author of pre-commit here) the framework intentionally does not provide a way to auto-commit modifications. Here’s a few issues which have asked for such: pre-commit/pre-commit#806 pre-commit/pre-commit#747 A comment from one of those issues: pre-commit itself will never touch the staging area. These are good ways to silently break commits. In my mind this is one … Read more

deneme bonusu veren sitelerbahis casinomakrobetceltabetpinbahispolobetpolobet girişpinbahis girişmakrobet girişpulibet girişmobilbahis girişkolaybet giriş