pre-commit handles flake8 now

old-commit-hash: 355159f04a
This commit is contained in:
Adeeb Shihadeh 2020-06-04 14:09:37 -07:00
parent 55c3a89421
commit e60e71c6da
4 changed files with 2 additions and 14 deletions

View File

@ -36,7 +36,7 @@ jobs:
external/bin selfdrive/modeld/runners $TEST_DIR
# need these so docker copy won't fail
cp Pipfile Pipfile.lock flake8_openpilot.sh pylint_openpilot.sh .pylintrc \
cp Pipfile Pipfile.lock pylint_openpilot.sh .pylintrc \
cppcheck_openpilot.sh .coveragerc-app .pre-commit-config.yaml $TEST_DIR
cd $TEST_DIR
mkdir laika laika_repo tools release
@ -73,8 +73,6 @@ jobs:
submodules: true
- name: Build Docker image
run: eval "$BUILD"
- name: flake8
run: $RUN "cd /tmp/openpilot/ && ./flake8_openpilot.sh"
- name: pylint
run: $RUN "cd /tmp/openpilot/ && ./pylint_openpilot.sh"
- name: pre-commit

View File

@ -22,7 +22,7 @@ All PRs and commits are automatically checked by Github Actions. Check out `.git
### Code Style and Linting
Code is automatically checked for style by Github Actions as part of the automated tests. You can also run these tests yourself by running `pylint_openpilot.sh` and `flake8_openpilot.sh`.
Code is automatically checked for style by Github Actions as part of the automated tests. You can also run these tests yourself by running `pre-commit run --all`.
## Car Ports (openpilot)

View File

@ -78,7 +78,6 @@ RUN mkdir -p /tmp/openpilot
COPY SConstruct \
cppcheck_openpilot.sh \
flake8_openpilot.sh \
pylint_openpilot.sh \
.pylintrc \
.pre-commit-config.yaml \

View File

@ -1,9 +0,0 @@
#!/usr/bin/env bash
# only pyflakes check (--select=F)
RESULT=$(python3 -m flake8 --select=F $(eval echo $(cat <(find cereal) <(find opendbc) release/files_common release/files_common | tr '\n' ' ') | tr ' ' '\n' | grep "\.py$"))
if [[ $RESULT ]]; then
echo "Pyflakes found errors in the code. Please fix and try again"
echo "$RESULT"
exit 1
fi