Skip to content

Commit fec4c38

Browse files
committed
Update CI to use black
1 parent 085c2d2 commit fec4c38

3 files changed

Lines changed: 9 additions & 7 deletions

File tree

.travis-yapf.sh renamed to .travis-black.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22

33
set -eux
44

5-
diff=$(yapf -rd geoip2 tests)
5+
diff=$(black --check .)
66

77
if [[ $? != 0 ]]; then
8-
echo "yapf failed to run."
8+
echo "black failed to run."
99
echo "$diff"
1010
exit $?
1111
elif [[ $diff ]]; then

.travis.yml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,14 +36,16 @@ before_install:
3636
- "if [[ $RUN_SNYK && $SNYK_TOKEN ]]; then sudo apt-get install -y nodejs; npm install -g snyk; fi"
3737
install:
3838
- pip install -r requirements.txt
39-
# We require yapf 0.28.0 to work around https://github.com/google/yapf/issues/781
40-
# If that issue is resolved, we should remove the version constraint.
41-
- pip install requests_mock pylint coveralls yapf==0.28.0
39+
- pip install requests_mock coveralls
40+
- |
41+
if [[ $RUN_LINTER ]]; then
42+
pip install --upgrade pylint black
43+
fi
4244
- "if [[ $RUN_SNYK && $SNYK_TOKEN ]]; then snyk test --org=maxmind; fi"
4345
script:
4446
- coverage run --source=geoip2 setup.py test
4547
- "if [[ $RUN_LINTER ]]; then ./.travis-pylint.sh; fi"
46-
- "if [[ $RUN_LINTER ]]; then ./.travis-yapf.sh; fi"
48+
- "if [[ $RUN_LINTER ]]; then ./.travis-black.sh; fi"
4749
after_success:
4850
- coveralls
4951
- "if [[ $RUN_SNYK && $SNYK_TOKEN && $TRAVIS_BRANCH == 'master' && $TRAVIS_PULL_REQUEST == 'false' ]]; then snyk monitor --org=maxmind --project-name=maxmind/GeoIP2-python; fi"

pylintrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[MESSAGES CONTROL]
2-
disable=R0201,R0205,R1705,W0105
2+
disable=C0330,R0201,R0205,W0105
33

44
[BASIC]
55

0 commit comments

Comments
 (0)