More LGTM fixups (#1457)

* exclude lib dirs, fix 3 cpp errors

* fix more alerts, exclude mkvparse

Co-authored-by: George Hotz <geohot@gmail.com>
pull/1460/head
George Hotz 2020-05-02 20:00:41 -07:00 committed by GitHub
parent eb67c74a44
commit e568d3cadc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
17 changed files with 12 additions and 34 deletions

View File

@ -1,3 +1,9 @@
path_classifiers:
library:
- external
- phonelibs
- pyextra
- tools/lib/mkvparse
extraction:
cpp:
after_prepare:

View File

@ -99,7 +99,7 @@ int visionstream_init(VisionStream *s, VisionStreamType type, bool tbuffer, Visi
close(s->ipc_fd);
return -1;
}
assert(rp.type = VIPC_STREAM_BUFS);
assert(rp.type == VIPC_STREAM_BUFS);
assert(rp.d.stream_bufs.type == type);
s->bufs_info = rp.d.stream_bufs;

View File

@ -3,10 +3,8 @@
import argparse
import time
import zmq
import cereal.messaging as messaging
from cereal.services import service_list
from selfdrive.controls.lib.alerts import ALERTS
def now_millis(): return time.time() * 1000

View File

@ -19,7 +19,7 @@ except PermissionError:
try:
with open('/tmp/test-results.json', 'r') as infile:
data = json.load(infile)
except:
except Exception:
data = {'sensor-pass': 0, 'sensor-fail': 0}
STARTUP_SCRIPT = "/data/data/com.termux/files/continue.sh"
@ -27,7 +27,7 @@ try:
with open(STARTUP_SCRIPT, 'w') as startup_script:
startup_script.write("#!/usr/bin/bash\n\n/data/openpilot/selfdrive/test/sensor_test_bootloop.py\n")
os.chmod(STARTUP_SCRIPT, stat.S_IRWXU)
except:
except Exception:
print("Failed to install new startup script -- aborting")
sys.exit(-1)

View File

@ -1,9 +1,7 @@
import os
import subprocess
from common.basedir import BASEDIR
from cffi import FFI
from ctypes import cdll
locationd_dir = os.path.dirname(os.path.abspath(__file__))
liblocationd_fn = os.path.join(locationd_dir, "liblocationd.so")

View File

@ -28,7 +28,7 @@ SNPEModel::SNPEModel(const char *path, float *output, size_t output_size, int ru
// load model
std::unique_ptr<zdl::DlContainer::IDlContainer> container = zdl::DlContainer::IDlContainer::open(model_data, model_size);
if (!container) { PrintErrorStringAndExit(); }
printf("loaded model with size: %u\n", model_size);
printf("loaded model with size: %lu\n", model_size);
// create model runner
zdl::SNPE::SNPEBuilder snpeBuilder(container.get());
@ -79,7 +79,7 @@ SNPEModel::SNPEModel(const char *path, float *output, size_t output_size, int ru
stride *= bufferShape[i];
strides[i-1] = stride;
}
printf("input product is %u\n", product);
printf("input product is %lu\n", product);
inputBuffer = ubFactory.createUserBuffer(NULL, product*sizeof(float), strides, &userBufferEncodingFloat);
inputMap.add(input_tensor_name, inputBuffer.get());

View File

@ -1,5 +1,4 @@
#!/usr/bin/env python
import struct
from common.numpy_fast import clip
from common.params import Params
from copy import copy

View File

@ -7,10 +7,8 @@
### this process needs pygame and can't run on the EON ###
import pygame
import zmq
import cereal.messaging as messaging
def joystick_thread():
joystick_sock = messaging.pub_sock('testJoystick')

View File

@ -1,4 +1,3 @@
import sys
import os
import requests
from tools.lib.auth_config import clear_token

View File

@ -1,12 +1,8 @@
#!/usr/bin/env python3
import json
import os
import sys
import webbrowser
from http.server import HTTPServer, BaseHTTPRequestHandler
from urllib.parse import urlencode, parse_qs
from common.file_helpers import mkdirs_exists_ok
from tools.lib.api import CommaApi, APIError
from tools.lib.auth_config import set_token

View File

@ -1,8 +1,6 @@
import os
import sys
import glob
import json
import time
import struct
import tempfile
import threading

View File

@ -1,7 +1,6 @@
#!/usr/bin/env python3
import os
import sys
import json
import bz2
import tempfile
import subprocess

View File

@ -1,5 +1,4 @@
import json
import os
import sys
from tools.lib.route import Route
@ -11,4 +10,4 @@ data_dump = {
"logs":routes.log_paths()
}
json.dump(data_dump, open("routes.json", "w"))
json.dump(data_dump, open("routes.json", "w"))

View File

@ -10,7 +10,6 @@ import pygame
import numpy as np
import cv2
import sys
from tools.lib.lazy_property import lazy_property
import cereal.messaging as messaging
_BB_OFFSET = 0, 0

View File

@ -1,12 +1,10 @@
#!/usr/bin/env python
import os
import sys
import matplotlib.pyplot as plt
import numpy as np
import cereal.messaging as messaging
import time
# tool to plot one or more signals live. Call ex:
#./rqplot.py log.carState.vEgo log.carState.aEgo

View File

@ -4,10 +4,7 @@ import os
import sys
import zmq
import time
import gc
import signal
from threading import Thread
import numpy as np
from uuid import uuid4
from collections import namedtuple
from collections import deque
@ -22,7 +19,6 @@ from cereal.services import service_list
from cereal.messaging import pub_sock, MultiplePublishersError
from common import realtime
from tools.lib.file_helpers import mkdirs_exists_ok
from tools.lib.kbhit import KBHit
from tools.lib.logreader import MultiLogIterator
from tools.lib.route import Route

View File

@ -1,15 +1,10 @@
#!/usr/bin/env python
import os
import sys
import argparse
import zmq
import json
import cv2
import numpy as np
from hexdump import hexdump
import scipy.misc
import struct
from collections import deque
# sudo pip install git+git://github.com/mikeboers/PyAV.git
import av