# See https://pre-commit.com for more information # See https://pre-commit.com/hooks.html for more hooks repos: - repo: https://github.com/pre-commit/pre-commit-hooks rev: v4.0.1 hooks: - id: trailing-whitespace - id: end-of-file-fixer - id: check-added-large-files - repo: https://github.com/asottile/pyupgrade rev: v2.21.2 hooks: - id: pyupgrade args: ["--py39-plus"] - repo: https://github.com/pycqa/isort rev: 5.9.2 hooks: - id: isort name: isort (python) args: - --profile=black - --line-length=120 # isort can't find local imports if the path of the local packages are not relative from the root of the repo. # In this case, packages need to be added here # - --known-local-folder= - repo: https://github.com/psf/black rev: 21.7b0 hooks: - id: black args: - --line-length=120 - --target-version=py39 - repo: https://github.com/PyCQA/flake8 rev: 3.9.2 hooks: - id: flake8 additional_dependencies: - flake8-bugbear - flake8-implicit-str-concat - flake8-annotations args: ["--max-line-length=120","--ignore=ANN001,ANN201,ANN101,ANN102,ANN002,F841,ANN204, ANN003,E203,E402, E401, F401, W503, E731"] # we ignore errors # -ANN101: "Missing type annotation for self in method" # -ANN102 "Missing type annotation for cls in classmethod" # -ANN002 "Missing type annotation for *args" # -ANN003 "Missing type annotation for *kwargs" # -E203 "whitespace before ':' because pep8 is wrong here. See https://github.com/psf/black/issues/315" # -E731 "do not assign a lambda expression, use a def"