-
Notifications
You must be signed in to change notification settings - Fork 11
/
.pre-commit-config.yaml
94 lines (86 loc) · 2.31 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
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.3.0
hooks:
- id: check-toml
- id: check-yaml
- id: end-of-file-fixer
- id: mixed-line-ending
- repo: https://github.com/psf/black
rev: 22.6.0
hooks:
- id: black
args: ["--check"]
- repo: https://github.com/PyCQA/isort
rev: 5.12.0
hooks:
- id: isort
args: ["--profile", "black"]
- repo: https://github.com/PyCQA/flake8
rev: 5.0.4
hooks:
- id: flake8
additional_dependencies: [mccabe]
args: ["--max-line-length", "100", "--max-complexity", "10"]
- repo: local
hooks:
- id: pylint
name: pylint
entry: pylint
language: system
types: [python]
args: [
"-rn", # Only display messages
"-sn", # Don't display the score
# TODO remove these disables, but enabling pylint on commit
# so we do not add any more pylint errors
"--disable",
"too-few-public-methods",
"--disable",
"fixme",
"--disable",
"too-many-instance-attributes",
"--disable",
"too-many-public-methods",
"--disable",
"too-many-arguments",
"--disable",
"duplicate-code",
"--disable",
"too-many-locals",
"--disable",
"too-many-ancestors",
"--disable",
"line-too-long",
"--extension-pkg-whitelist='pydantic'",
]
- repo: local
hooks:
- id: mypy
name: mypy
entry: poetry run mypy scope3_methodology
pass_filenames: false
verbose: true
language: system
types: [python]
- repo: https://github.com/python-poetry/poetry
rev: "1.8.4"
hooks:
- id: poetry-check
- id: poetry-lock
args: ["--no-update"]
- id: poetry-export
args: ["-f", "requirements.txt", "-o", "requirements.txt"]
- repo: https://github.com/pre-commit/mirrors-prettier
rev: v2.7.1
hooks:
- id: prettier
- repo: local
hooks:
- id: unit-test
name: pytest
entry: poetry run pytest
pass_filenames: false
verbose: true
language: system
types: [python]