forked from carla-simulator/scenario_runner
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
65 lines (60 loc) · 3.67 KB
/
.travis.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
#
# Copyright (c) 2019 Intel Corporation
#
# This work is licensed under the terms of the MIT license.
# For a copy, see <https://opensource.org/licenses/MIT>.
#
os: linux
dist: xenial
sudo: false
matrix:
include:
- env: TEST="Check code formatting"
addons:
apt:
packages:
- pep8
- python-autopep8
- python-pep8
script:
- autopep8 srunner/scenariomanager/*.py --in-place --max-line-length=120
- autopep8 srunner/scenariomanager/scenarioatomics/*.py --in-place --max-line-length=120
- autopep8 srunner/scenarios/*.py --in-place --max-line-length=120
- autopep8 srunner/tools/*.py --in-place --max-line-length=120
- autopep8 srunner/scenarioconfigs/*.py --in-place --max-line-length=120
- autopep8 scenario_runner.py --in-place --max-line-length=120
- autopep8 srunner/challenge/autoagents/*.py --in-place --max-line-length=120
- autopep8 srunner/challenge/challenge_statistics_manager.py --in-place --max-line-length=120
- git diff --quiet HEAD --; if [ ! $? -eq 0 ]; then echo "Code is not autopep8 compliant. Please run code_check_and_formatting.sh"; git diff HEAD --; exit 1; fi
after_failure:
- tail --lines=2000 build.log
- env: TEST="Check static code analysis"
addons:
apt:
packages:
- python-pip
before_install:
- pip2 install --user pylint==1.9.4
- pip2 install --user py_trees==0.8.3 networkx==2.2 psutil shapely numpy xmlschema==1.0.18 opencv-python
script:
- pylint --version
- static_code_quality_passed=1
- pylint --rcfile=.pylintrc --disable=I srunner/scenariomanager
- pylint --rcfile=.pylintrc --disable=I srunner/scenarios
- pylint --rcfile=.pylintrc --disable=I srunner/tools
- pylint --rcfile=.pylintrc --disable=I srunner/scenarioconfigs
- pylint --rcfile=.pylintrc --disable=I scenario_runner.py
- pylint --rcfile=.pylintrc --disable=I srunner/challenge/autoagents
- pylint --rcfile=.pylintrc --disable=I srunner/challenge/challenge_statistics_manager.py
- score=`pylint --rcfile=.pylintrc --disable=I srunner/scenariomanager | grep -i "rated at" | awk '{print $7}'`; if [ "$score" != "10.00/10" ]; then static_code_quality_passed=0; fi
- score=`pylint --rcfile=.pylintrc --disable=I srunner/scenarios | grep -i "rated at" | awk '{print $7}'`; if [ "$score" != "10.00/10" ]; then static_code_quality_passed=0; fi
- score=`pylint --rcfile=.pylintrc --disable=I srunner/tools | grep -i "rated at" | awk '{print $7}'`; if [ "$score" != "10.00/10" ]; then static_code_quality_passed=0; fi
- score=`pylint --rcfile=.pylintrc --disable=I srunner/scenarioconfigs | grep -i "rated at" | awk '{print $7}'`; if [ "$score" != "10.00/10" ]; then static_code_quality_passed=0; fi
- score=`pylint --rcfile=.pylintrc --disable=I scenario_runner.py | grep -i "rated at" | awk '{print $7}'`; if [ "$score" != "10.00/10" ]; then static_code_quality_passed=0; fi
- score=`pylint --rcfile=.pylintrc --disable=I srunner/challenge/autoagents | grep -i "rated at" | awk '{print $7}'`; if [ "$score" != "10.00/10" ]; then static_code_quality_passed=0; fi
- score=`pylint --rcfile=.pylintrc --disable=I srunner/challenge/challenge_statistics_manager.py | grep -i "rated at" | awk '{print $7}'`; if [ "$score" != "10.00/10" ]; then static_code_quality_passed=0; fi
- if [ $static_code_quality_passed -eq 0 ]; then echo "Code is not pylint compliant. Please run code_check_and_formatting.sh"; exit 1; fi
after_failure:
- tail --lines=2000 build.log
notifications:
email: false