mirror of
https://github.com/Grasscutters/mitmproxy.git
synced 2024-11-27 10:26:23 +00:00
improve travis coding style checks
This commit is contained in:
parent
1dda164d03
commit
e805f2d066
1
.gitignore
vendored
1
.gitignore
vendored
@ -9,5 +9,6 @@ MANIFEST
|
|||||||
.coverage
|
.coverage
|
||||||
.idea/
|
.idea/
|
||||||
__pycache__
|
__pycache__
|
||||||
|
_cffi__*
|
||||||
netlib.egg-info/
|
netlib.egg-info/
|
||||||
pathod/
|
pathod/
|
||||||
|
@ -9,8 +9,7 @@ install:
|
|||||||
# command to run tests, e.g. python setup.py test
|
# command to run tests, e.g. python setup.py test
|
||||||
script:
|
script:
|
||||||
- "nosetests --with-cov --cov-report term-missing"
|
- "nosetests --with-cov --cov-report term-missing"
|
||||||
- "autopep8 -i -r -a -a . && test -z \"$(git status -s)\""
|
- "./check_coding_style.sh"
|
||||||
- "autoflake -r -i --remove-all-unused-imports --remove-unused-variables . && test -z \"$(git status -s)\""
|
|
||||||
after_success:
|
after_success:
|
||||||
- coveralls
|
- coveralls
|
||||||
notifications:
|
notifications:
|
||||||
|
20
check_coding_style.sh
Executable file
20
check_coding_style.sh
Executable file
@ -0,0 +1,20 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
autopep8 -i -r -a -a .
|
||||||
|
if [[ -n "$(git status -s)" ]]; then
|
||||||
|
echo "autopep8 yielded the following changes:"
|
||||||
|
git status -s
|
||||||
|
git --no-pager diff
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
autoflake -i -r --remove-all-unused-imports --remove-unused-variables .
|
||||||
|
if [[ -n "$(git status -s)" ]]; then
|
||||||
|
echo "autoflake yielded the following changes:"
|
||||||
|
git status -s
|
||||||
|
git --no-pager diff
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "Coding style seems to be ok."
|
||||||
|
exit 0
|
Loading…
Reference in New Issue
Block a user