-
Notifications
You must be signed in to change notification settings - Fork 9
/
.pre-commit-config.yaml
58 lines (58 loc) · 1.67 KB
/
.pre-commit-config.yaml
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
46
47
48
49
50
51
52
53
54
55
56
57
58
default_language_version:
python: python3.12
repos:
- repo: "https://github.com/pre-commit/pre-commit-hooks"
rev: v4.6.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-added-large-files
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.4.10
hooks:
# Run the linter
- id: ruff
types_or: [python, pyi]
args: [--fix, --exit-non-zero-on-fix, --config=pyproject.toml]
# Run the formatter
- id: ruff-format
args: [--config=pyproject.toml]
- repo: "https://github.com/pycqa/bandit"
rev: 1.7.8
hooks:
- id: bandit
# skips asserts
# - https://bandit.readthedocs.io/en/latest/plugins/b101_assert_used.html#
# - https://bandit.readthedocs.io/en/latest/plugins/b104_hardcoded_bind_all_interfaces.html
args:
- "--skip"
- "B101,B104,B311"
- repo: "https://github.com/pre-commit/mirrors-mypy"
rev: v1.10.0
hooks:
- id: mypy
files: "^merino|^tests"
args:
[
--python-version=3.12,
--disallow-untyped-calls,
--follow-imports=normal,
--ignore-missing-imports,
--pretty,
--show-error-codes,
--strict-optional,
--warn-no-return,
--warn-redundant-casts,
--warn-return-any,
--warn-unused-ignores,
]
additional_dependencies:
[
"pydantic",
"types-geoip2",
"types-PyYAML",
"types-requests",
"types-redis",
"types-python-dateutil",
"types-Pillow",
]