Skip to content

Commit 5aa81ee

Browse files
committed
Run black on each commit with travis
1 parent 2dab3f9 commit 5aa81ee

File tree

3 files changed

+12
-6
lines changed

3 files changed

+12
-6
lines changed

.pre-commit-config.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
repos:
22
- repo: https://github.com/ambv/black
3-
rev: stable
3+
rev: 18.9b0
44
hooks:
55
- id: black
66
language_version: python3.6

.travis.yml

+9-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11

2-
language: cpp
2+
language: python
3+
python:
4+
- "2.7"
5+
- "3.6"
36
sudo: required
47

58
services:
@@ -10,13 +13,15 @@ git:
1013
submodules: false
1114

1215
before_install:
13-
- sudo apt update && sudo apt install -y python-pip python-dev protobuf-compiler
16+
- sudo apt update && sudo apt install -y protobuf-compiler
1417
- sed -i 's,git\@github.com:\([^/]*\)/\(.*\).git,https://github.com/\1/\2,' .gitmodules
1518
- git submodule update --init --recursive
16-
- sudo pip install -r source/tyr/requirements_dev.txt
19+
- if [[ $TRAVIS_PYTHON_VERSION == '2.7' ]]; then pip install -r source/tyr/requirements_dev.txt; fi
20+
- if [[ $TRAVIS_PYTHON_VERSION == '3.6' ]]; then python3.6 -m pip install black==18.9b0; fi
1721
- bash source/scripts/build_protobuf.sh
1822

1923
script:
2024
# Make sure submodules references are merged in !
2125
- bash source/scripts/check_submodules.sh
22-
- pushd source/tyr && PYTHONPATH=.:../navitiacommon/ py.test && popd
26+
- if [[ $TRAVIS_PYTHON_VERSION == '2.7' ]]; then pushd source/tyr && PYTHONPATH=.:../navitiacommon/ py.test && popd; fi
27+
- if [[ $TRAVIS_PYTHON_VERSION == '3.6' ]]; then black --check --diff .; fi

pyproject.toml

+2-1
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,6 @@ exclude = '''
1111
| debug
1212
| debian
1313
| source/third_party
14-
)/
14+
| .*_pb2\.py
15+
)
1516
'''

0 commit comments

Comments
 (0)