-
Notifications
You must be signed in to change notification settings - Fork 36
/
.pre-commit-config.yaml
151 lines (133 loc) · 3.91 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
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
# A config file for pre-commit.com
#
# Documentation
# https://github.com/specifysystems/code-principles/blob/main/pre-commit-hooks.md
default_language_version:
python: python3
default_stages:
- commit
- merge-commit
exclude: ^(lib|.idea)
repos:
- repo: local
hooks:
- id: frontend-tests
name: TypeScript, Jest and localization tests
description: Run TypeScript typechecker and automated tests on .ts files
entry: /bin/bash -c "cd specifyweb/frontend/js_src && npm run test"
language: script
types_or: [javascript, jsx, ts, tsx]
pass_filenames: false
- repo: https://github.com/maxpatiiuk/pre-commit
rev: v1.0.5
hooks:
- id: regex-blacklist
args:
- specifyweb/frontend/js_src/lib/tests/regexBlacklist.txt
- repo: local
hooks:
- id: mypy
name: mypy
description: Python mypy typechecker
entry: /bin/bash -c "docker exec --tty specify7_specify7_1 bash -c 'VIRTUAL_ENV=./ve make typecheck'"
language: script
types: [python]
pass_filenames: false
#- repo: https://github.com/pre-commit/mirrors-mypy
#- repo: https://github.com/pre-commit/mirrors-eslint
#- repo: https://github.com/awebdeveloper/pre-commit-stylelint
# global hooks:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.0.1
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-added-large-files
- id: check-case-conflict
- id: check-docstring-first
- id: check-xml
- id: check-shebang-scripts-are-executable
- id: check-merge-conflict
- id: check-symlinks
- id: detect-private-key
- id: mixed-line-ending
- id: requirements-txt-fixer
- id: fix-byte-order-marker
- id: fix-encoding-pragma
- id: forbid-new-submodules
- repo: https://github.com/codespell-project/codespell
rev: v2.1.0
hooks:
- id: codespell
args:
- --skip="./node_modules/,package-lock.json,./.idea/"
- repo: https://github.com/psf/black
rev: 21.11b1
hooks:
- id: black
args:
- --line-length=72
- repo: https://gitlab.com/pycqa/flake8
rev: 3.9.2
hooks:
- id: flake8
additional_dependencies:
- flake8-bugbear
args:
# these settings are needed to make flake8 compatible with black
- --max-line-length=88
- --select=C,E,F,W,B,B950
- --extend-ignore=E203,E501
- repo: https://github.com/terrencepreilly/darglint
rev: v1.8.1
hooks:
- id: darglint
args:
- -v 2
- repo: https://github.com/PyCQA/pydocstyle
rev: 6.1.1
hooks:
- id: pydocstyle
- repo: https://github.com/asottile/pyupgrade
rev: v2.29.1
hooks:
- id: pyupgrade
- repo: https://github.com/asottile/setup-cfg-fmt
rev: v1.20.0
hooks:
- id: setup-cfg-fmt
- repo: https://github.com/pre-commit/mirrors-prettier
rev: v2.5.0
hooks:
- id: prettier
additional_dependencies:
- "@prettier/plugin-xml@^0.13.1"
- prettier-plugin-package@^1.3.0
- prettier-plugin-sh@^0.8.1
- prettier-plugin-tailwind-css@^1.5.0
- prettier-plugin-firebase-database@^1.0.1
- repo: https://github.com/Lucas-C/pre-commit-hooks-safety
rev: v1.2.2
hooks:
- id: python-safety-dependencies-check
- repo: https://github.com/jorisroovers/gitlint
rev: v0.16.0
hooks:
- id: gitlint
- repo: https://github.com/IamTheFij/docker-pre-commit
rev: v2.0.1
hooks:
- id: docker-compose-check
- repo: https://github.com/markdownlint/markdownlint
rev: v0.11.0
hooks:
- id: markdownlint
files: \.md$
args:
- --git-recurse
- repo: https://github.com/maxpatiiuk/mirrors-jscpd
rev: v3.3.26
hooks:
- id: jscpd
types: [text]