This repository was archived by the owner on Jan 29, 2026. It is now read-only.
Travis CI: lint Python for syntax errors and undefined names#147
Merged
animeshsingh merged 3 commits intoIBM:masterfrom Nov 8, 2018
Merged
Travis CI: lint Python for syntax errors and undefined names#147animeshsingh merged 3 commits intoIBM:masterfrom
animeshsingh merged 3 commits intoIBM:masterfrom
Conversation
added 3 commits
October 19, 2018 16:53
In Travis CI, add a Python linting step that runs [flake8](http://flake8.pycqa.org) to find syntax errors and undefined names. [flake8](http://flake8.pycqa.org) testing of https://github.com/IBM/FfDL on Python 3.7.0 $ __flake8 . --count --select=E901,E999,F821,F822,F823 --show-source --statistics__ ``` ./etc/examples/c10d-onnx-mpi/model-files/train_dist_onnx_mpi.py:93:55: F821 undefined name 'bsz' num_batches = ceil(len(train_set.dataset) / float(bsz)) ^ ./etc/examples/c10d-dist-onnx/model-files/train_dist_onnx.py:121:14: E999 SyntaxError: positional argument follows keyword argument ', epoch ', epoch, '. avg_loss: ', ^ 1 E999 SyntaxError: positional argument follows keyword argument 1 F821 undefined name 'bsz' 2 ``` __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. * 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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
In Travis CI, add a Python linting step that runs flake8 to find syntax errors and undefined names.
flake8 testing of https://github.com/IBM/FfDL on Python 3.7.0
$ flake8 . --count --select=E901,E999,F821,F822,F823 --show-source --statistics
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.
namenamein__all__Developer's Certificate of Origin 1.1