jerry-git / learn-python3

Jupyter notebooks for teaching/learning Python 3
MIT License
6.43k stars 1.77k forks source link

Test for Python syntax errors and undefined names #2

Closed cclauss closed 6 years ago

cclauss commented 6 years ago

These tests will pass when #1 is resolved.

http://flake8.pycqa.org will flag the build if there are Python syntax errors or undefined names.

E901,E999,F821,F822,F823 are the "showstopper" flake8 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. This PR therefore recommends a flake8 run of these tests on the entire codebase.

jerry-git commented 6 years ago

Thanks for the PR!

Since flake8 is linting .py files, the entire codebase is in this case only a single file which contains some configuration code that should be added to jupyter_notebook_config.py. Thus, I think this is a bit overkill for the repo. In addition, I explained in #1 why this may not be a good idea for the potential future .py files.

Anyway, I think that most Python repos should have some kind of automatic linting as part of their CI system and flake8 is usually the best option for that. It's just not a good fit for this project.