-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.pre-commit-config.yaml
96 lines (88 loc) · 2.58 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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
default_language_version:
python: python3.11
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
- id: check-added-large-files
- id: check-case-conflict
- id: check-docstring-first
- id: check-json
- id: check-merge-conflict
- id: check-toml
- id: check-yaml
- id: detect-private-key
- id: name-tests-test
args: [ --pytest-test-first ]
- id: pretty-format-json
args: [ --autofix ]
- id: trailing-whitespace
args: [ --markdown-linebreak-ext=md ]
- repo: https://github.com/asottile/pyupgrade
rev: v3.19.1
hooks:
- id: pyupgrade
args:
- --py3-plus
- --keep-runtime-typing
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.8.4
hooks:
# Run the linter.
- id: ruff
args: [ "--fix", "--exit-non-zero-on-fix", "--config",
"pyproject.toml" ]
- repo: https://github.com/pycqa/isort
rev: 5.13.2
hooks:
- id: isort
name: isort (python)
args: [ "--sp", "pyproject.toml" ]
# Using this mirror lets us use mypyc-compiled black, which is about 2x faster
- repo: https://github.com/psf/black-pre-commit-mirror
rev: 24.10.0
hooks:
- id: black
args: [ "--config", "pyproject.toml" ]
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.8.4
hooks:
# Run the formatter.
- id: ruff-format
args: [ "--config", "pyproject.toml" ]
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.14.0
hooks:
- id: mypy
args: [ --config-file=./pyproject.toml ]
additional_dependencies:
[
pydantic,
pydantic-settings,
jinja2,
passlib,
packaging,
click,
aiosmtplib,
aiofiles,
asyncpg,
types-redis,
types-passlib,
types-aiofiles,
uvicorn,
]
- repo: https://github.com/PyCQA/bandit
rev: 1.8.0
hooks:
- id: bandit
args: [ "-c", "pyproject.toml" ]
additional_dependencies: [ "bandit[toml]" ]
- repo: local
hooks:
- id: block-env
name: Block .env file
entry: bash -c 'if git diff --cached --name-only | grep -qE "^.env|^.env.example^.env.sample"; then echo ".env files must not be committed" && exit 1; else exit 0; fi'
language: system
types: [ text ]