I'm using the pre-commit to manage my pre-commit and pre-push hooks.
I have two hooks (mypy and pylint), and I need to install the requirements to the virtual-env.
My directory structure:
- project
- .pre-commit-config.yaml
- path
- to
- my
- requierment.txt
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v0.812
hooks:
- id: mypy
stages: [ "push" ]
args: [ "--config-file", "mypy.ini" ]
additional_dependencies: [ "-rpath/to/my/requirements.txt" ]
- repo: https://github.com/PyCQA/pylint
rev: v2.8.3
hooks:
- id: pylint
stages: [ "push" ]
args: [ "--rcfile=.pylintrc" ]
additional_dependencies: [ "-rpath/to/my/requirements.txt" ]
When I try this (please follow the additional_dependencies), the pre-commit can't find the file.
How can I fix it? Using a relative path.
Thanks :)
Update:
I've just found another solution to my questions, using my system python interpreter, using the language
attribute with the system option
.
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v0.812
hooks:
- id: mypy
language: system
stages: [ "push" ]
args: [ "--config-file", "mypy.ini" ]
- repo: https://github.com/PyCQA/pylint
rev: v2.8.3
hooks:
- id: pylint
language: system
stages: [ "push" ]
args: [ "--rcfile=.pylintrc" ]