-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
[examples] final pep8 fixes #3774
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
Merged
Merged
Changes from 1 commit
Commits
Show all changes
26 commits
Select commit
Hold shift + click to select a range
5cba226
fix trailing whitespace
twmr 8cae397
fix multiple whitespace issues in svg_*.py examples (E293, E291)
twmr 2f5b1e1
pep8 fix E201
twmr cc7fc7f
pep8 fix e2* in examples dir part 1/2
twmr b680680
pep8 fix e2* in examples dir part 2/2
twmr b081c92
pep8 fix E701
twmr 0130bb9
pep8 fix E502 (redundant backslash)
twmr b959c79
pep8 fix e702,e703
twmr 7122484
pep8 fix E302
twmr fa2ee50
remove blacklisted examples from coding style unittest
twmr eef2efc
ignore line to long errors for pep8 unit tests in examples/
twmr 6289558
pep8 fix E124-E129
twmr 16e1566
pep fix E401
twmr 1e822e9
fix all issues in the output of the pep8 unit test
twmr 85519f0
decrease the number of ignored pep8 error classes
twmr 111cdab
consider @weathergods suggestions
twmr 192a26c
prettify instantiation of ellipsecollection object
twmr e53ba3e
avoid triple quoted string
twmr 3bd0f57
fix mutable default arguments
twmr 2da662b
don't use implicit tuple assignment
twmr cb0467d
prettify instantiation of Linecollection obj even further
twmr 2cb5403
Revert "pep8 fix E201"
twmr a79053c
fix pep8 unit tests
twmr 9591cb8
minor cleanup in pipong example (0 + value)
twmr eab5b52
fixed extraneous whitespace
twmr 2303939
fix pep8 violations in the new boxplot examples
twmr File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
pep8 fix E201
- Loading branch information
commit 2f5b1e17e2d286a39127a8c9586200ce788c02aa
There are no files selected for viewing
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 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 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 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 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
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.
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.
You can leave your change as-is, if it makes the pep8 checker happy; but for the record, this is an example where the original is better, and I think entirely within the original spirit and meaning of PEP 8 as a whole.
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.
On second thought, if there is any reasonable way to leave these in their original version, I think you should do so. At some point, one must simply resist the mindless tyranny of mechanical PEP 8 checking.
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.
I agree with you that the original was (slightly) better. The benefit of this version is that I don't have to blacklist E201 'whitespace after ‘(‘' as a whole in the unit tests. What I could try is to only blacklist E201 for the files in 3ef582b
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.
OK. I don't know where the blacklisting is done, so I don't know what the options really are. When you say "as a whole", does that mean for the examples, or does it mean throughout the codebase?
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.
The blacklisting is done in
test_coding_standards.py
. By 'as a whole' I just meant the examples - see https://github.com/matplotlib/matplotlib/pull/3774/files#diff-13006e1a4da2e47c3f768fdd0f2cfaebR279There 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.
throwing
# noqa
on the end of a line should exclude it from the pep8 checking.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.
Interesting; but that would be ugly and would defeat the whole purpose, which should be to make the code as readable and pleasant to work with as possible.
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.
As the person responsible for maintaining this file, I too would like this section to remain as it is.
There are other examples with the exact same block of numbers; they too should remain as they were.
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.
@efiring by line, I mean expression, there should only need to be on
# noqa
which isn't too bad.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.
# noqa
doesn't work for all warnings/errors, see this issue PyCQA/pycodestyle#180. I'll try to come up with a different fix.