forked from python-trio/trio
-
Notifications
You must be signed in to change notification settings - Fork 0
/
check.sh
executable file
·44 lines (34 loc) · 1.2 KB
/
check.sh
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
#!/bin/bash
set -ex
EXIT_STATUS=0
# Test if the generated code is still up to date
python ./trio/_tools/gen_exports.py --test \
|| EXIT_STATUS=$?
# Autoformatter *first*, to avoid double-reporting errors
# (we'd like to run further autoformatters but *after* merging;
# see https://forum.bors.tech/t/pre-test-and-pre-merge-hooks/322)
# autoflake --recursive --in-place .
# pyupgrade --py3-plus $(find . -name "*.py")
yapf -rpd setup.py trio \
|| EXIT_STATUS=$?
# Run flake8 without pycodestyle and import-related errors
flake8 trio/ \
--ignore=D,E,W,F401,F403,F405,F821,F822\
|| EXIT_STATUS=$?
# Finally, leave a really clear warning of any issues and exit
if [ $EXIT_STATUS -ne 0 ]; then
cat <<EOF
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Problems were found by static analysis (listed above).
To fix formatting and see remaining errors, run
pip install -r test-requirements.txt
yapf -rpi setup.py trio
./check.sh
in your local checkout.
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
EOF
exit 1
fi
exit 0