-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy path.pre-commit-config.yaml
executable file
·62 lines (55 loc) · 1.8 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
repos:
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.8.0
hooks:
- id: mypy
exclude: deprecated|deploy|venv
additional_dependencies:
- sqlmodel==0.0.22
args: [--python-version=3.12, --ignore-missing-imports, --install-types, --non-interactive,]
- repo: local
hooks:
# update version on constants.py
- id: version_updater
name: version_updater
entry: python3 ./src/version_updater.py
language: python
# For reformatting code
- id: black
name: black
entry: black
language: python
types: [ python ]
args: [ --line-length=88, --target-version=py312, --force-exclude, src/db/migrations/*]
# For upgrade python code syntax for newer versions of the language
- id: pyupgrade
name: pyupgrade
entry: pyupgrade
language: python
types: [ python ]
# Tool for automatically reordering python imports
- id: reorder-python-imports
name: reorder-python-imports
entry: reorder-python-imports
language: python
types: [ python ]
# Removes unused imports and unused variables from Python code
- id: autoflake
name: autoflake
entry: autoflake
language: python
types: [ python ]
args: [ --in-place, --remove-all-unused-imports, --remove-duplicate-keys ]
# sort __all__ statements
- id: sort-all
name: Sort __all__ records
description: Automatically Sort __all__ records alphabetically.
entry: sort-all
language: python
types: [ python ]
- id: pytest-check
name: pytest-check
entry: pytest --cov=src tests/
language: system
pass_filenames: false
fail_fast: true