Skip to content

Commit

Permalink
CI: Run flake8 on Python 3.7
Browse files Browse the repository at this point in the history
Yet another attempt at ArduPilot#7131 because without automated test, these _undefined names_ keep creeping back into the codebase: ArduPilot#9225, ArduPilot#9226, ArduPilot#9229, ArduPilot#9788, ArduPilot#10038, and a new one below...

[flake8](http://flake8.pycqa.org) testing of https://github.com/ArduPilot/ardupilot on Python 3.7.1

$ __flake8 . --count --select=E901,E999,F821,F822,F823 --show-source --statistics__
```
./Tools/autotest/sim_vehicle.py:396:39: F821 undefined name 'autotest'
    swarminit_filepath = os.path.join(autotest, "swarminit.txt")
                                      ^
1     F821 undefined name 'autotest'
```
__E901,E999,F821,F822,F823__ are the "_showstopper_" [flake8](http://flake8.pycqa.org) issues that can halt the runtime with a SyntaxError, NameError, etc. Most other flake8 issues are merely "style violations" -- useful for readability but they do not effect runtime safety.
* F821: undefined name `name`
* F822: undefined name `name` in `__all__`
* F823: local variable name referenced before assignment
* E901: SyntaxError or IndentationError
* E999: SyntaxError -- failed to compile a file into an Abstract Syntax Tree
  • Loading branch information
cclauss authored and tridge committed Jan 22, 2019
1 parent f98bfb1 commit f5d23f8
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,3 +70,12 @@ matrix:
- if: type != cron
compiler: "clang"
env: CI_BUILD_TARGET="sitltest-rover sitltest-sub""
- language: python
python: 3.7
addons: # speedup: This test does not need addons
compiler:
dist: xenial # required for Python >= 3.7 (travis-ci/travis-ci#9069)
before_install: pip install flake8
script:
- EXCLUDE=./.*,./modules/gtest,./modules/ChibiOS/test,./modules/uavcan/libuavcan
- flake8 . --count --exclude=$EXCLUDE --select=E901,E999,F821,F822,F823 --show-source --statistics

0 comments on commit f5d23f8

Please sign in to comment.