Closed leezu closed 6 years ago
I usually do it in two passes like this:
# stop the build if there are Python syntax errors or undefined names
- flake8 . --count --select=E901,E999,F821,F822,F823 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
- flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
The first pass halts the build on error but the second just treats "style violations" as warnings.
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 should therefore recommend a flake8 run of these tests on the entire codebase.
name
name
in __all__
name
referenced before assignmentThanks. I believe we should enforce E901,E999,F821,F822,F823
on the CI. I have enabled the check for them following your suggestion in https://github.com/dmlc/gluon-nlp/pull/213 (subject to review).
I would be happy to also enforce style related issues (once they are all fixed or selectively disabled), but let's see what others think.
@cclauss has pointed out several issues discoverd by running flake8. We may want to run it on CI too.
Currently the following issues need to be addressed before flake8 will run without errors on CI (or selectively disabled):