-
Notifications
You must be signed in to change notification settings - Fork 0
/
.pre-commit-config.yaml
68 lines (63 loc) · 1.57 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
---
minimum_pre_commit_version: 2.20.0
exclude: ^(docs|tests)
repos:
# commit-msg hooks
# ----------
# Conventional Commit message checker (commitizen)
- repo: https://github.com/commitizen-tools/commitizen
rev: v2.28.1
hooks:
- id: commitizen
stages:
- commit-msg
# pre-commit hooks
# ----------
# Standard pre-commit rules
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
hooks:
- id: check-case-conflict
- id: check-executables-have-shebangs
- id: check-shebang-scripts-are-executable
- id: detect-private-key
- id: end-of-file-fixer
- id: trailing-whitespace
args:
- --markdown-linebreak-ext=md
# Black (uncompromising) Python code formatter
- repo: https://github.com/psf/black
rev: 24.2.0
hooks:
- id: black
args:
- --target-version
- py310
# MyPy
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.8.0
hooks:
- id: mypy
files: ^src
args:
- --ignore-missing-imports
additional_dependencies:
- types-protobuf
- types-PyYAML
- types-python-dateutil
- types-pytz
- types-requests
# Pylint
# To check import errors we need to install every package
# used by the DM. This is often impractical on the client,
# and so we disable import errors on pre-commit and rely
# on this category of test in the CI stage. Consequently,
# pylint may pass on pre-commit but fail in CI - but at least
# the user has done 90% of the lint checks before the code
# hits the server.
- repo: https://github.com/pycqa/pylint
rev: v3.1.0
hooks:
- id: pylint
args:
- --disable=import-error