mfss-positioning/.pre-commit-config.yaml
2025-04-30 13:35:30 +07:00

98 lines
2.9 KiB
YAML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

repos:
# Базовые хуки
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
- id: trailing-whitespace
- id: check-yaml
- id: check-json
exclude: launch.json
- id: check-case-conflict
- id: check-merge-conflict
- id: end-of-file-fixer
# isort - сортировка импортов (совместимый с black)
- repo: https://github.com/pycqa/isort
rev: 6.0.1
hooks:
- id: isort
name: isort (python)
args: [ "--profile", "black", "--filter-files" ]
# flynt - конвертация в f-строки
- repo: https://github.com/ikamensh/flynt
rev: 1.0.1
hooks:
- id: flynt
args: [ "--transform-concats" ]
- repo: https://github.com/adamchainz/django-upgrade
rev: "1.24.0" # replace with latest tag on GitHub
hooks:
- id: django-upgrade
args: [ --target-version, "5.2" ]
# black - форматирование кода
- repo: https://github.com/psf/black
rev: 25.1.0
hooks:
- id: black
language_version: python3
# flake8 с плагинами
- repo: https://github.com/PyCQA/flake8
rev: 5.0.4
hooks:
- id: flake8
additional_dependencies:
- flake8-blind-except==0.2.1
- flake8-broken-line==0.6.0
- flake8-bugbear==22.9.23
- flake8-builtins==2.0.0
# - flake8-class-attributes-order==0.1.3
- flake8-cognitive-complexity==0.1.0
- flake8-comprehensions==3.10.0
- flake8-debugger==4.1.2
- flake8-eradicate==1.4.0
- flake8-functions==0.0.7
# - flake8-isort==5.0.0
- flake8-mutable==1.2.0
- flake8-print==5.0.0
- flake8-pytest==1.4
- flake8-pytest-style==1.6.0
- flake8-quotes==3.3.1
- flake8-string-format==0.3.0
- flake8-variables-names==0.0.5
args: [
"--max-line-length=115",
"--ignore=E203,W503, CCE001",
"--max-complexity=10",
"--jobs=1",
"--multiline-quotes=double",
"--docstring-quotes=double",
"--inline-quotes=double"
]
# mypy - статическая проверка типов
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.15.0
hooks:
- id: mypy
exclude: migrations/
args: [
"--ignore-missing-imports",
"--disallow-untyped-defs",
"--explicit-package-bases",
"--show-error-codes"
]
additional_dependencies: [ types-requests ]
# pygrep-hooks - дополнительные проверки
- repo: https://github.com/pre-commit/pygrep-hooks
rev: v1.10.0
hooks:
- id: python-check-blanket-noqa
- id: python-check-mock-methods
- id: python-no-log-warn
- id: python-use-type-annotations