-
Notifications
You must be signed in to change notification settings - Fork 4
/
.pre-commit-config.yaml
44 lines (44 loc) · 1.16 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
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v3.3.0
hooks:
- id: trailing-whitespace
- repo: https://github.com/kynan/nbstripout
rev: master
hooks:
- id: nbstripout
- repo: https://github.com/ambv/black
rev: stable
hooks:
- id: black
files: '(src|tests).*py'
- repo: https://github.com/PyCQA/isort
rev: 5.6.4
hooks:
- id: isort
args: ["-m", "3", "--tc"]
- repo: local
hooks:
- id: poetry
name: sync setup.py with poetry
entry: |
bash -c ' \
if [[ $CI ]]; then
exit 0
fi
V=$(poetry version -s);
poetry build && tar -xvf dist/whaler-$V.tar.gz -C dist && diff dist/whaler-$V/setup.py setup.py \
|| cp dist/whaler-$V/setup.py setup.py \
'
language: system
pass_filenames: false
files: pyproject.toml|poetry.lock
- repo: local
hooks:
- id: pyright
name: pyright
entry: poetry run pyright
language: node
pass_filenames: false
types: [python]
additional_dependencies: ["[email protected]"]