-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.pre-commit-config.yaml
67 lines (67 loc) · 1.82 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
# To install the git pre-commit hook run:
# pre-commit install
# To update the pre-commit hooks run:
# pre-commit install-hooks
exclude: '^(\.bumpversion\.cfg)(/|$)'
default_language_version:
# force all unspecified python hooks to run python3
python: python3.10
minimum_pre_commit_version: "1.20.0"
repos:
- repo: meta
hooks:
- id: identity
- id: check-hooks-apply
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
hooks:
- id: check-merge-conflict
- id: debug-statements
- id: check-builtin-literals
- id: detect-private-key
- id: end-of-file-fixer
- id: mixed-line-ending
# - id: check-executables-have-shebangs
- id: trailing-whitespace
- id: fix-encoding-pragma
args:
- --remove
- repo: https://github.com/ikamensh/flynt/
rev: '0.77'
hooks:
- id: flynt
- repo: local
hooks:
- id: mypy
name: mypy
language: system
entry: poetry run mypy
types: [python]
exclude: ^docs/
- id: black
name: black
language: system
entry: poetry run black
types: [python]
exclude: ^docs/conf\.py$
- id: ruff
name: ruff
language: system
require_serial: true
entry: |-
python -c '
import os, subprocess, sys;
args = ["poetry", "run", "ruff", "--fix", "--no-update-check"]
if "GITHUB_ACTIONS" in os.environ:
args += ["--format=github"]
args += sys.argv[1:]
exit(subprocess.run(args).returncode)
'
types: [python]
exclude: ^docs/conf\.py$
- id: safety
name: safety
language: system
entry: poetry run safety check -i 39462 -i 40291
pass_filenames: false
types: [python]