pre-commit handles flake8 now

old-commit-hash: 355159f04a
commatwo_master
Adeeb Shihadeh 5 years ago
parent 55c3a89421
commit e60e71c6da
  1. 4
      .github/workflows/test.yaml
  2. 2
      CONTRIBUTING.md
  3. 1
      Dockerfile.openpilot
  4. 9
      flake8_openpilot.sh

@ -36,7 +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 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 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
@ -73,8 +73,6 @@ jobs:
submodules: true submodules: true
- name: Build Docker image - name: Build Docker image
run: eval "$BUILD" run: eval "$BUILD"
- name: flake8
run: $RUN "cd /tmp/openpilot/ && ./flake8_openpilot.sh"
- name: pylint - name: pylint
run: $RUN "cd /tmp/openpilot/ && ./pylint_openpilot.sh" run: $RUN "cd /tmp/openpilot/ && ./pylint_openpilot.sh"
- name: pre-commit - name: pre-commit

@ -22,7 +22,7 @@ All PRs and commits are automatically checked by Github Actions. Check out `.git
### Code Style and Linting ### 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) ## Car Ports (openpilot)

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

@ -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
Loading…
Cancel
Save