-
Notifications
You must be signed in to change notification settings - Fork 294
Get Flake8 looking clean #20
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
Closed
Closed
Conversation
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
This is mostly just removing dead variables, however, there are a few substantial changes in here: - Move to using try/except ImportError/else in tests where we are checking some module existing, as this was hiding genuine bugs that manifested themselves as ImportError (the etree treewalker was throwing ImportError when being imported). - Fixes the ImportError the etree treewalker was throwing (this was, too, reported as a bug by pyflakes, thereby showing its value). However, given it has been untested for a while, it is unsurprisingly broken, failing thousands of tests. - The parser defined the scriptDataDoubleEscapedDashState twice, therefore everything that should've been run in this state was in fact run in the scriptDataDoubleEscapedDashDashState. This also adds flake8 to Travis, albeit running it without any PEP 8 errors showing.
The two violations: - We don't in general comply with the 79 character per line limit. - constants.py violates (at least according to pep8) the hanging indent rule. On the whole, I disagree with the tool and have filed <PyCQA/pycodestyle#189> with regards to this.
This is effectively the treewalker equivalent of 3e50aad: Don't rely on the ElementTree Comment factory being the tag attribute on Comments. This is needed for xml.etree.cElementTree under 2.6 (and likely hence custom installs of cElementTree 1.2), where the tag property is equal to xml.etree.ElementTree.Comment (i.e., the pure Python version).
It turns out flake8's behaviour differs between Python 2 and Python 3 because of the changes between the two, so run it on both on Travis.
Manually merged in 5b94a06 and immediate parents. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This addresses both pyflakes and pep8. See commit messages for more detail. In fixing this, this fixes #1.