-
Notifications
You must be signed in to change notification settings - Fork 14
/
.pre-commit-config.yaml
128 lines (112 loc) · 2.74 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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
# BACKEND
repos:
# Check yaml files like this one and github actions if they are valid
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
hooks:
- id: check-yaml
# Autoformat yaml files
- repo: https://github.com/macisamuele/language-formatters-pre-commit-hooks
rev: v2.8.0
hooks:
- id: pretty-format-yaml
args: [--autofix, --indent, '2']
# Check github action workflow files
- repo: https://github.com/sirosen/check-jsonschema
rev: 0.22.0
hooks:
- id: check-github-workflows
# Check toml files like pyproject.toml if it is valid
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
hooks:
- id: check-toml
# As the name says
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
hooks:
- id: double-quote-string-fixer
# Convert simple things like set([]) to set()
- repo: https://github.com/asottile/pyupgrade
rev: v3.3.1
hooks:
- id: pyupgrade
# Remove unused imports
- repo: https://github.com/hadialqattan/pycln
rev: v2.1.3
hooks:
- id: pycln
args: [--config=pyproject.toml]
# Convert relative to absolute imports
- repo: https://github.com/MarcoGorelli/absolufy-imports
rev: v0.3.1
hooks:
- id: absolufy-imports
# Sort imports
- repo: https://github.com/pycqa/isort
rev: 5.12.0
hooks:
- id: isort
files: \.(py)$
args: [--settings-path=pyproject.toml]
# Add trailing commas - might be unwanted in some places
- repo: https://github.com/asottile/add-trailing-comma
rev: v2.4.0
hooks:
- id: add-trailing-comma
# Autoformat code
- repo: local
hooks:
- id: yapf
name: yapf
stages: [commit]
language: system
entry: poetry run yapf -i
types: [python]
exclude: setup.py
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
hooks:
# Check if python files are vlaid
- id: check-ast
- id: check-builtin-literals
- id: check-docstring-first
- id: debug-statements
- repo: https://github.com/pre-commit/pygrep-hooks
rev: v1.10.0
hooks:
# Check for bad code
- id: python-no-eval
- id: python-no-log-warn
# Enforce type annotation instead of comment annotation
- id: python-use-type-annotations
# Integration test / Python
- repo: local
hooks:
- id: pylint
name: pylint
stages: [commit]
language: system
entry: poetry run pylint
types: [python]
# FRONTEND
- repo: local
hooks:
- id: prettier
name: prettier
stages: [commit]
language: system
entry: npm run format
pass_filenames: false
- id: eslint
name: eslint
stages: [commit]
language: system
entry: npm run eslint
pass_filenames: false
- id: jest_frontend_test
name: jest frontend test
stages: [commit]
language: system
entry: npm run testAll
pass_filenames: false