feat(template): Make pre-commit hooks read configs from config files

When possible, for pre-commit hooks, instead of receiving arguments via
command line, make them read their config from a configuration file to
achieve the same behavior as invoking the corresponding tool outside
pre-commit.
This commit is contained in:
Dionisio E Alonso 2024-02-26 11:32:51 -03:00
parent 5d6c98a528
commit bd435b7730
1 changed files with 4 additions and 12 deletions

View File

@ -19,19 +19,15 @@ repos:
rev: 7.0.0
hooks:
- id: flake8
args: [--max-line-length=120]
args: [--toml-config=./pyproject.toml]
additional_dependencies: [Flake8-pyproject]
language: system # don't commit!!
- repo: https://github.com/PyCQA/pylint
rev: v3.0.3
hooks:
- id: pylint
args: [
--max-line-length=120,
"--disable=missing-docstring,invalid-name,redefined-outer-name,logging-format-interpolation,too-many-ancestors,too-few-public-methods",
--disable=import-error,
--max-args=7,
]
args: [--rcfile=./pyproject.toml]
# disabled plugins: pylint.extensions.mccabe
exclude: tests|tests/input|tests/extensions/data|tests/regrtest_data|tests/data|doc
language: system # don't commit!!
@ -40,11 +36,7 @@ repos:
rev: v1.8.0
hooks:
- id: mypy
args: [
--ignore-missing-imports,
--follow-imports=silent,
--show-column-numbers,
]
args: [--show-column-numbers, --pretty, --ignore-missing-imports, --follow-imports=silent]
additional_dependencies: [types-all]
#exclude: migrations/
language: system # don't commit!!