Skip to content

Commit 31cc64b

Browse files
committed
Add yapf test
1 parent 04c8914 commit 31cc64b

File tree

3 files changed

+19
-1
lines changed

3 files changed

+19
-1
lines changed

.travis-pylint.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/bin/sh
2+
python setup.py install
3+
pylint geoip2

.travis-yapf.sh

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#!/bin/bash
2+
3+
diff=$(yapf -rd geoip2 tests)
4+
5+
if [[ $? != 0 ]]; then
6+
echo "yapf failed to run."
7+
echo "$diff"
8+
exit $?
9+
elif [[ $diff ]]; then
10+
echo "$diff"
11+
exit 1
12+
else
13+
exit 0
14+
fi

.travis.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@ install:
3131
- "if [[ $TRAVIS_PYTHON_VERSION == '2.7' ]]; then pip install ipaddr; fi"
3232
script:
3333
- coverage run --source=geoip2 setup.py test
34-
- "if [[ $TRAVIS_PYTHON_VERSION == '2.7' ]]; then pylint geoip2; fi"
34+
- "if [[ $TRAVIS_PYTHON_VERSION == '3.6' ]]; then ./.travis-pylint.sh; fi"
35+
- "if [[ $TRAVIS_PYTHON_VERSION == '3.6' ]]; then ./.travis-yapf.sh; fi"
3536
after_success:
3637
- coveralls
3738
notifications:

0 commit comments

Comments
 (0)