-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.pre-commit-config.yaml
67 lines (58 loc) · 1.73 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
exclude: '^docs/|/migrations/'
default_stages: [ commit ]
fail_fast: false
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-json
- id: check-toml
- id: check-xml
- id: check-yaml
- id: debug-statements
- id: check-builtin-literals
- id: check-case-conflict
- id: check-docstring-first
- id: detect-private-key
- repo: https://github.com/asottile/pyupgrade
rev: v3.7.0
hooks:
- id: pyupgrade
args: [ --py311-plus ]
- repo: https://github.com/PyCQA/isort
rev: 5.12.0
hooks:
- id: isort
- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff: https://github.com/astral-sh/ruff-pre-commit
rev: v0.0.280
hooks:
- id: ruff
args: [ --fix, --exit-non-zero-on-fix ]
types_or: [ python, pyi, jupyter ]
- repo: https://github.com/psf/black
rev: 23.3.0
hooks:
- id: black
- repo: https://github.com/PyCQA/bandit
rev: 1.7.5
hooks:
- id: bandit
args: [ "-c", "bandit.yaml" ]
- repo: https://github.com/sourcery-ai/sourcery
# Source: https://docs.sourcery.ai/Guides/Getting-Started/Pre-Commit/
# https://sourcery.ai/blog/python-best-practices/
rev: v1.6.0
hooks:
- id: sourcery
# only check the files which have changed: does not work on first commit
args: [ --diff=git diff HEAD, --no-summary ]
# args: [ --diff=git diff HEAD, --fix, --no-summary ]
# args: [ --fix, --no-summary ]
# sets up .pre-commit-ci.yaml to ensure pre-commit dependencies stay up to date
ci:
autoupdate_schedule: weekly
skip: [ ]
submodules: false