Skip to content

Commit c4989eb

Browse files
committed
Run yapf tidy test in Travis
1 parent b9750bd commit c4989eb

File tree

3 files changed

+18
-3
lines changed

3 files changed

+18
-3
lines changed

.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 maxminddb 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: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,15 @@ before_install:
1717
- sudo make install
1818
- sudo ldconfig
1919
- cd ..
20-
- pip install pylint coveralls
20+
- pip install coveralls
21+
- if [[ $TRAVIS_PYTHON_VERSION == '3.6' ]]; then pip install pylint yapf; fi
2122
- if [[ $TRAVIS_PYTHON_VERSION == '2.6' ]]; then pip install unittest2; fi
2223

2324
script:
2425
- if [[ $TRAVIS_PYTHON_VERSION != 'pypy' ]]; then export MM_FORCE_EXT_TESTS=1; fi
2526
- CFLAGS="-Werror -Wall -Wextra" python setup.py test
26-
- if [[ $TRAVIS_PYTHON_VERSION == '2.7' ]]; then pylint --rcfile .pylintrc maxminddb/*.py; fi
27+
- if [[ $TRAVIS_PYTHON_VERSION == '3.6' ]]; then pylint --rcfile .pylintrc maxminddb/*.py; fi
28+
- if [[ $TRAVIS_PYTHON_VERSION == '3.6' ]]; then ./.travis-yapf.sh; fi
2729

2830
after_success:
2931
- coveralls

HISTORY.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ History
66
* Fix issue where incorrect size was used when unpacking some types with the
77
pure Python reader. Reported by Lee Symes. GitHub #30.
88

9-
109
1.3.0 (2017-03-13)
1110
++++++++++++++++++
1211

0 commit comments

Comments
 (0)