Net-Mist_remy/.pre-commit-config.yaml
2024-03-15 09:12:20 +01:00

55 lines
1.9 KiB
YAML

repos:
# General
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-added-large-files
# Python
- repo: https://github.com/asottile/pyupgrade
rev: v3.3.1
hooks:
- id: pyupgrade
args: ["--py310-plus"]
- repo: https://github.com/pycqa/isort
rev: 5.12.0
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: 23.1.0
hooks:
- id: black-jupyter
args:
- --line-length=120
- --target-version=py310
- repo: https://github.com/PyCQA/flake8
rev: 6.0.0
hooks:
- id: flake8
additional_dependencies:
- flake8-bugbear
- flake8-implicit-str-concat
- flake8-annotations
args: ["--max-line-length=120", "--ignore=ANN204,ANN101,ANN102,ANN002,ANN003,E203,W503"]
# we ignore errors
# -ANN204: "Missing return type annotation for special method"
# -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"
# -W503 "Line break occurred before a binary operator" See https://www.flake8rules.com/rules/W503.html
# -E203: whitespace before ':' because pep8 is wrong here. See https://github.com/psf/black/issues/315
- repo: https://github.com/pre-commit/mirrors-prettier
rev: v3.0.0-alpha.6
hooks:
- id: prettier
args: ["--print-width=120"]