[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 |
|
|
||
| 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.
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.
All showstopper issue tests pass except for F821 which is what makes it special.
There was a problem hiding this comment.
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.
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.
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 |
aaltay
left a comment
There was a problem hiding this comment.
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.
namenamein__all__namereferenced before assignmentDESCRIPTION HERE
Follow this checklist to help us incorporate your contribution quickly and easily:
[BEAM-XXX] Fixes bug in ApproximateQuantiles, where you replaceBEAM-XXXwith the appropriate JIRA issue.mvn clean verifyto make sure basic checks pass. A more thorough check will be performed on your pull request automatically.