Skip to content
Permalink
Browse files

Add pylint to travis-ci (#595)

* Add pylint to travis-ci

* Change travis build order

* Fix missing pylint

* Add pylint to dockerfile

* Test with fixed linter for chrysler changes

* Fix linter issues in OP

* fixed linter on ford

* Fix Riccardo's comments
  • Loading branch information...
legonigel committed Apr 13, 2019
1 parent 185375e commit 76dfb135ca049ddd3ceadb6ce8b024c9c8193c2a
585 .pylintrc

Large diffs are not rendered by default.

Oops, something went wrong.
@@ -7,8 +7,12 @@ install:
- docker build -t tmppilot -f Dockerfile.openpilot .

script:
- docker run
tmppilot /bin/sh -c 'cd /tmp/openpilot/selfdrive/test/ && ./test_fingerprints.py'
- docker run
tmppilot /bin/sh -c 'cd /tmp/openpilot/ && pyflakes $(find . -iname "*.py" | grep -vi "^\./pyextra.*" | grep -vi "^\./panda")'
- docker run
tmppilot /bin/sh -c 'cd /tmp/openpilot/ && pylint $(find . -iname "*.py" | grep -vi "^\./pyextra.*" | grep -vi "^\./panda"); exit $(($? & 3))'
- docker run
-v "$(pwd)"/selfdrive/test/tests/plant/out:/tmp/openpilot/selfdrive/test/tests/plant/out
tmppilot /bin/sh -c 'cd /tmp/openpilot/selfdrive/test/tests/plant && OPTEST=1 ./test_longitudinal.py'
- docker run
tmppilot /bin/sh -c 'cd /tmp/openpilot/selfdrive/test/ && ./test_fingerprints.py'
@@ -28,12 +28,14 @@ RUN pip install -r /tmp/requirements_openpilot.txt

ENV PYTHONPATH /tmp/openpilot:$PYTHONPATH

COPY ./.pylintrc /tmp/openpilot/.pylintrc
COPY ./common /tmp/openpilot/common
COPY ./cereal /tmp/openpilot/cereal
COPY ./opendbc /tmp/openpilot/opendbc
COPY ./selfdrive /tmp/openpilot/selfdrive
COPY ./phonelibs /tmp/openpilot/phonelibs
COPY ./pyextra /tmp/openpilot/pyextra
COPY ./panda /tmp/openpilot/panda

RUN mkdir -p /tmp/openpilot/selfdrive/test/out
RUN make -C /tmp/openpilot/selfdrive/controls/lib/longitudinal_mpc clean
@@ -23,13 +23,15 @@ enum34==1.1.6
evdev==0.6.1
fastcluster==1.1.20
filterpy==1.2.4
hexdump
ipaddress==1.0.16
json-rpc==1.12.1
libusb1==1.5.0
lmdb==0.92
mpmath==1.0.0
nose==1.3.7
numpy==1.11.1
opencv-python==3.4.0.12
pause==0.1.2
py==1.4.31
pyOpenSSL==16.0.0
@@ -39,6 +41,7 @@ pycapnp==0.6.3
pycparser==2.18
pycrypto==2.6.1
pyflakes==1.6.0
pylint==1.8.3
pyopencl==2016.1
pyparsing==2.1.10
#pypcap==1.1.5 needs extra dependencies and is not used
@@ -1,5 +1,4 @@
from cereal import car
from selfdrive.car.chrysler.values import CAR


VisualAlert = car.CarControl.HUDControl.VisualAlert
@@ -1,6 +1,4 @@
import chryslercan
from values import CAR
from carcontroller import CarController
from selfdrive.can.packer import CANPacker

from cereal import car
@@ -6,7 +6,7 @@
from selfdrive.controls.lib.drive_helpers import EventTypes as ET, create_event
from selfdrive.controls.lib.vehicle_model import VehicleModel
from selfdrive.car.ford.carstate import CarState, get_can_parser
from selfdrive.car.ford.fordcan import MAX_ANGLE
from selfdrive.car.ford.values import MAX_ANGLE

try:
from selfdrive.car.ford.carcontroller import CarController
@@ -1,12 +1,14 @@
from selfdrive.car import dbc_dict

MAX_ANGLE = 87. # make sure we never command the extremes (0xfff) which cause latching fault

class CAR:
FUSION = "FORD FUSION 2018"

FINGERPRINTS = {
CAR.FUSION: [{
71: 8, 74: 8, 75: 8, 76: 8, 90: 8, 92: 8, 93: 8, 118: 8, 119: 8, 120: 8, 125: 8, 129: 8, 130: 8, 131: 8, 132: 8, 133: 8, 145: 8, 146: 8, 357: 8, 359: 8, 360: 8, 361: 8, 376: 8, 390: 8, 391: 8, 392: 8, 394: 8, 512: 8, 514: 8, 516: 8, 531: 8, 532: 8, 534: 8, 535: 8, 560: 8, 578: 8, 604: 8, 613: 8, 673: 8, 827: 8, 848: 8, 934: 8, 935: 8, 936: 8, 947: 8, 963: 8, 970: 8, 972: 8, 973: 8, 984: 8, 992: 8, 994: 8, 997: 8, 998: 8, 1003: 8, 1034: 8, 1045: 8, 1046: 8, 1053: 8, 1054: 8, 1058: 8, 1059: 8, 1068: 8, 1072: 8, 1073: 8, 1082: 8, 1107: 8, 1108: 8, 1109: 8, 1110: 8, 1200: 8, 1427: 8, 1430: 8, 1438: 8, 1459: 8
}],
}],
}

DBC = {
@@ -66,7 +66,7 @@ def to_string(cls, kind):


def run_car_ekf_offline(kf, observations_by_kind):
from laika.raw_gnss import GNSSMeasurement
from laika.raw_gnss import GNSSMeasurement # pylint: disable=import-error
observations = []
# create list of observations with element format: [kind, time, data]
for kind in observations_by_kind:
@@ -131,7 +131,7 @@ def run_observations_through_filter(kf, observations, filter_time=None):

def save_residuals_plot(obs, save_path, data_name):
import matplotlib.pyplot as plt
import mpld3
import mpld3 # pylint: disable=import-error
fig = plt.figure(figsize=(10,20))
fig.suptitle('Residuals of ' + data_name, fontsize=24)
n = len(obs.keys())
@@ -462,7 +462,7 @@ def main():
# support additional internal only extensions
try:
import selfdrive.manager_extensions
selfdrive.manager_extensions.register(register_managed_process)
selfdrive.manager_extensions.register(register_managed_process) # pylint: disable=no-member
except ImportError:
pass

@@ -1,5 +1,5 @@
#!/usr/bin/env python
import pygame
import pygame # pylint: disable=import-error
from plant import Plant
from selfdrive.car.honda.values import CruiseButtons
import numpy as np

0 comments on commit 76dfb13

Please sign in to comment.
You can’t perform that action at this time.