-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BEAM-3738] Add more flake8 tests to run_pylint.sh #4798
Conversation
Could you also update https://github.com/apache/beam/blob/master/sdks/python/run_mini_py3lint.sh ? |
+1 to this direction. On a higher note, is there a JIRA issue or thread we should be coordinating this work on (or at least referencing). |
In general, I have been focused on https://issues.apache.org/jira/browse/BEAM-1251 |
@cclauss https://issues.apache.org/jira/browse/BEAM-1251 is an umbrella bug for all python 3 changes. Whenever possible, it makes sense to create sub-issues. Lint for python 3 support should have its own issue at least. Could you also reference issues in the PR title in the "[BEAM-XYZ] ..." format? |
retest this please |
@@ -37,4 +37,5 @@ if test $# -gt 0; then | |||
fi | |||
|
|||
echo "Running flake8 for module $MODULE:" | |||
flake8 $MODULE --count --select=E999 --show-source --statistics | |||
# TODO: Add F821 (undefined names) as soon as that test passes |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Which test passes? Do we have a JIRA tracking this?
Also why F821 is special compared to any other warning to be mentioned in this todo?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All showstopper issue tests pass except for F821 which is what makes it special.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are other errors/violation codes that are not enabled including F821: http://flake8.pycqa.org/en/latest/user/error-codes.html
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please reread the first sentence of description above which discusses the "showstopper" flake8 issues vs. the "style violations". I have been focused on the former for the reasons described above.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is fine to move that sentence to a JIRA, and add a todo referencing that JIRA. People reading that TODO once it is merged would not easily be able to find the PR and understand what is the todo for, and what needs to happen to resolve it.
You can also reference the issues you have noticed with F821 as you mentioned in your other comment in that same JIRA.
F821 status (there are PRs open for most of these)... $ python3 -m flake8 . --count --select=E9,F821,F822,F823 --show-source --statistics
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you. I will update the the todo to mention the newly opened JIRA during merge.
My sense is that E901,E999,F821,F822,F823 are the "showstopper" flake8 issues that can halt the runtime with a SyntaxError, NameError, etc. The other flake8 issues are merely "style violations" -- useful for readability but they do not effect runtime safety.
This PR therefore recommends replacing --select=E999 with --select=E901,E999,F822,F823 because the codebase currently passes all of these tests and we would like to avoid any backsliding. We would also want to add F821 (undefined names!) to that list but work must be completed on basestring, buffer(), cmp(), file(), reduce(), unicode, xrange(), and #4561 before that can be done.
name
name
in__all__
name
referenced before assignmentDESCRIPTION HERE
Follow this checklist to help us incorporate your contribution quickly and easily:
[BEAM-XXX] Fixes bug in ApproximateQuantiles
, where you replaceBEAM-XXX
with the appropriate JIRA issue.mvn clean verify
to make sure basic checks pass. A more thorough check will be performed on your pull request automatically.