pre-commit also handles pylint
parent
355159f04a
commit
966e2d4154
|
@ -36,8 +36,7 @@ jobs:
|
||||||
external/bin selfdrive/modeld/runners $TEST_DIR
|
external/bin selfdrive/modeld/runners $TEST_DIR
|
||||||
|
|
||||||
# need these so docker copy won't fail
|
# need these so docker copy won't fail
|
||||||
cp Pipfile Pipfile.lock pylint_openpilot.sh .pylintrc \
|
cp Pipfile Pipfile.lock .pylintrc cppcheck_openpilot.sh .coveragerc-app .pre-commit-config.yaml $TEST_DIR
|
||||||
cppcheck_openpilot.sh .coveragerc-app .pre-commit-config.yaml $TEST_DIR
|
|
||||||
cd $TEST_DIR
|
cd $TEST_DIR
|
||||||
mkdir laika laika_repo tools release
|
mkdir laika laika_repo tools release
|
||||||
- name: Build Docker image
|
- name: Build Docker image
|
||||||
|
@ -73,8 +72,6 @@ jobs:
|
||||||
submodules: true
|
submodules: true
|
||||||
- name: Build Docker image
|
- name: Build Docker image
|
||||||
run: eval "$BUILD"
|
run: eval "$BUILD"
|
||||||
- name: pylint
|
|
||||||
run: $RUN "cd /tmp/openpilot/ && ./pylint_openpilot.sh"
|
|
||||||
- name: pre-commit
|
- name: pre-commit
|
||||||
run: $RUN "cd /tmp/openpilot/ && git init && git add -A && pre-commit run --all"
|
run: $RUN "cd /tmp/openpilot/ && git init && git add -A && pre-commit run --all"
|
||||||
- name: cppcheck
|
- name: cppcheck
|
||||||
|
|
|
@ -78,7 +78,6 @@ RUN mkdir -p /tmp/openpilot
|
||||||
|
|
||||||
COPY SConstruct \
|
COPY SConstruct \
|
||||||
cppcheck_openpilot.sh \
|
cppcheck_openpilot.sh \
|
||||||
pylint_openpilot.sh \
|
|
||||||
.pylintrc \
|
.pylintrc \
|
||||||
.pre-commit-config.yaml \
|
.pre-commit-config.yaml \
|
||||||
.coveragerc-app \
|
.coveragerc-app \
|
||||||
|
|
|
@ -1,11 +0,0 @@
|
||||||
#!/usr/bin/env bash
|
|
||||||
|
|
||||||
python3 -m pylint --disable=R,C,W $(eval echo <(find cereal) <(find opendbc) $(cat release/files_common release/files_common | tr '\n' ' ') | tr ' ' '\n' | grep "\.py$")
|
|
||||||
|
|
||||||
exit_status=$?
|
|
||||||
(( res = exit_status & 3 ))
|
|
||||||
|
|
||||||
if [[ $res != 0 ]]; then
|
|
||||||
echo "Pylint found errors in the code. Please fix and try again"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
Loading…
Reference in New Issue