-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.pre-commit-config.yaml
More file actions
45 lines (41 loc) · 1.35 KB
/
Copy path.pre-commit-config.yaml
File metadata and controls
45 lines (41 loc) · 1.35 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-yaml
- id: check-toml
- id: check-merge-conflict
- id: debug-statements
- repo: https://github.com/psf/black
rev: 25.1.0
hooks:
- id: black
language_version: python3.13
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.15.1
hooks:
- id: ruff
args: [--fix, --exit-non-zero-on-fix]
- repo: https://github.com/pycqa/flake8
rev: 7.1.1
hooks:
- id: flake8
args: ["--max-line-length=120"]
# mypy runs against the project's own telegram-bot/mypy.ini rather than a
# second, stricter ad-hoc flag set. mypy.ini encodes deliberate per-module
# relaxations (SQLAlchemy Column-vs-scalar, dynamic Telegram update objects);
# the mirrors-mypy hook ignored it and reported 282 pre-existing errors, so
# this hook could never pass. It must also run from telegram-bot/, because
# mypy.ini sets `mypy_path = .`.
- repo: local
hooks:
- id: mypy
name: mypy (telegram-bot)
language: system
pass_filenames: false
files: ^telegram-bot/.*\.py$
entry: >-
bash -c 'cd telegram-bot
&& "${MYPY_PYTHON:-.venv/bin/python}" -m mypy --config-file=mypy.ini .'