Pre-commit allows repository local hooks which are useful for project-specific lints.
For hooks with the language script you can specify its path just using entry, e.g:
- repo: local
hooks:
- id: check-x
name: Check X
entry: ./bin/check-x.sh
language: script
However when you use the language python, the entry is just the name of the entry point of the Python package to use. How can I tell it where the Python package is located within my repo?
despite your assertion,
entryis not the python package -- but the executable to be used. it is common that this matches the python package provided, but is not a requirement or a guarantee for python packaging (pre-commit/pre-commit-hooks has many examples where they do not match)pre-commit never installs the repository under test so you'll not have access to any executables that may be provided by packages there.
for
repo: local,language: pythoncan refer to either executables provided by things inadditional_dependenciesor it can be paths to scripts within your repository (the same aslanguage: script)disclaimer: I wrote pre-commit