forked from RoboSats/robosats
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.pre-commit-config.yaml
76 lines (76 loc) · 2.17 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
# TODO
# add a hook which automatically generates the OpenApi schema on API changes
# and places them in an appropriate location
exclude: '(api|chat|control)/migrations/.*'
repos:
- repo: 'https://github.com/pre-commit/pre-commit-hooks'
rev: v2.3.0
hooks:
- id: check-merge-conflict
- id: check-yaml
- id: check-toml
- id: mixed-line-ending
args:
- '--fix=lf'
- id: trailing-whitespace
- id: pretty-format-json
exclude: ^frontend/
args:
- '--autofix'
- '--no-sort-keys'
- '--no-ensure-ascii'
- id: check-builtin-literals
- id: check-docstring-first
- repo: local
hooks:
- id: collect-phrases
name: Collect i18n phrases
stages:
- commit
- merge-commit
language: system
files: ^frontend/src/
types_or: [javascript, jsx, ts, tsx] # uses https://github.com/pre-commit/identify
entry: bash -c 'cd frontend/static/locales && python3 collect_phrases.py'
- id: prettier-frontend
name: prettier-frontend
stages:
- commit
- merge-commit
language: system
files: ^frontend/
types_or: [javascript, jsx, ts, tsx, css, markdown, json] # uses https://github.com/pre-commit/identify
entry: bash -c 'cd frontend && npm run format'
- id: prettier-mobile
name: prettier-mobile
stages:
- commit
- merge-commit
language: system
files: ^mobile/
types_or: [javascript, jsx, ts, tsx, css, markdown, json] # uses https://github.com/pre-commit/identify
entry: bash -c 'cd mobile && npm run format'
- id: isort
name: isort
stages:
- commit
- merge-commit
language: system
types: [python]
entry: isort
- id: black
name: black
stages:
- commit
- merge-commit
language: system
types: [python]
entry: black
- id: flake8
name: flake8
stages:
- commit
- merge-commit
language: system
types: [python]
entry: flake8