-
Notifications
You must be signed in to change notification settings - Fork 755
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
Add W504 for line breaks before binary operators #502
Conversation
@IanLee1521 I know the tests are failing, and I'm going to have to figure out how to fix them, but I'd love some code review. |
pep8.py
Outdated
@@ -1018,7 +1018,15 @@ def explicit_line_join(logical_line, tokens): | |||
parens -= 1 | |||
|
|||
|
|||
def break_around_binary_operator(logical_line, tokens): | |||
def _is_binary_operator(token_type, text): | |||
# The % character is strictly speaking a binary operator, but the |
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.
Minor, but I'd prefer to move this to a """..."""
style doc string rather than #
since we're touching it anyways.
@sigmavirus24 -- Made a few in line comments, nothing major, overall looks good to me 👍 if we fix the tests I have no issues merging. |
@sigmavirus24 -- I've been working most of the day on fixing the tests and getting some other things merged. I captured the branch at: https://github.com/PyCQA/pycodestyle/tree/gh-502 I'm on the last failure (https://travis-ci.org/PyCQA/pycodestyle/builds/140304242) still chipping away if you have any thoughts... |
Are there any updates on this? My team would very much like to use it. If development has stalled, could we grab the branch and polish it off? |
@hoylemd, thanks for the interest! @IanLee1521 has updated this a bit on https://github.com/PyCQA/pycodestyle/tree/gh-502 but there are still failing tests. If you can fix those, you're welcome to take over this work and submit a new PR! |
- removed pep8 from the travis.yml until PyCQA/pycodestyle#502 is merged. - fixed one additional style issue
- removed pep8 from the travis.yml until PyCQA/pycodestyle#502 is merged. - fixed one additional style issue
- removed pep8 from the travis.yml until PyCQA/pycodestyle#502 is merged. - fixed one additional style issue
- removed pep8 from the travis.yml until PyCQA/pycodestyle#502 is merged. - fixed one additional style issue
- removed pep8 from the travis.yml until PyCQA/pycodestyle#502 is merged. - fixed one additional style issue
Ideally I'd like to have a check for this, but pycodestyle doesn't have one yet. See also PyCQA/pycodestyle#502.
It looks like flake8 assumed this was going to be merged and already ignores it by default? |
The only thing holding this back are failing tests, right? |
This commit updates to comply with the style of [flake8 rule W504](PyCQA/pycodestyle#502) where previously this code was styled to comply with [flake8 rule W503](https://lintlyci.github.io/Flake8Rules/rules/W503.html) which has fallen out of favor. W503 is set to be ignored
This commit updates to comply with the style of [flake8 rule W504](PyCQA/pycodestyle#502) where previously this code was styled to comply with [flake8 rule W503](https://lintlyci.github.io/Flake8Rules/rules/W503.html) which has fallen out of favor. W503 is set to be ignored
This commit updates to comply with the style of [flake8 rule W504](PyCQA/pycodestyle#502) where previously this code was styled to comply with [flake8 rule W503](https://lintlyci.github.io/Flake8Rules/rules/W503.html) which has fallen out of favor. W503 is set to be ignored
This commit updates to comply with the style of [flake8 rule W504](PyCQA/pycodestyle#502) where previously this code was styled to comply with [flake8 rule W503](https://lintlyci.github.io/Flake8Rules/rules/W503.html) which has fallen out of favor. W503 is set to be ignored (cherry picked from commit 0fe98e1)
This commit updates to comply with the style of [flake8 rule W504](PyCQA/pycodestyle#502) where previously this code was styled to comply with [flake8 rule W503](https://lintlyci.github.io/Flake8Rules/rules/W503.html) which has fallen out of favor. W503 is set to be ignored (cherry picked from commit 0fe98e1)
This commit updates to comply with the style of [flake8 rule W504](PyCQA/pycodestyle#502) where previously this code was styled to comply with [flake8 rule W503](https://lintlyci.github.io/Flake8Rules/rules/W503.html) which has fallen out of favor. W503 is set to be ignored (cherry picked from commit 0fe98e1)
This commit updates to comply with the style of [flake8 rule W504](PyCQA/pycodestyle#502) where previously this code was styled to comply with [flake8 rule W503](https://lintlyci.github.io/Flake8Rules/rules/W503.html) which has fallen out of favor. W503 is set to be ignored (cherry picked from commit 0fe98e1)
This commit updates to comply with the style of [flake8 rule W504](PyCQA/pycodestyle#502) where previously this code was styled to comply with [flake8 rule W503](https://lintlyci.github.io/Flake8Rules/rules/W503.html) which has fallen out of favor. W503 is set to be ignored (cherry picked from commit 0fe98e1)
Was introduced in PyCQA/pycodestyle#502 it seems. Makes travis on master fail https://travis-ci.org/ros-infrastructure/rosdep/jobs/445522297
…e W504 (#636) * format_map is python 3.2 or later only (see also #602) * Ignore new pycodestyle rule W504 Was introduced in PyCQA/pycodestyle#502 it seems. Makes travis on master fail https://travis-ci.org/ros-infrastructure/rosdep/jobs/445522297
This commit updates to comply with the style of [flake8 rule W504](PyCQA/pycodestyle#502) where previously this code was styled to comply with [flake8 rule W503](https://lintlyci.github.io/Flake8Rules/rules/W503.html) which has fallen out of favor. W503 is set to be ignored (cherry picked from commit 0fe98e1)
This commit updates to comply with the style of [flake8 rule W504](PyCQA/pycodestyle#502) where previously this code was styled to comply with [flake8 rule W503](https://lintlyci.github.io/Flake8Rules/rules/W503.html) which has fallen out of favor. W503 is set to be ignored (cherry picked from commit 0fe98e1)
This commit updates to comply with the style of [flake8 rule W504](PyCQA/pycodestyle#502) where previously this code was styled to comply with [flake8 rule W503](https://lintlyci.github.io/Flake8Rules/rules/W503.html) which has fallen out of favor. W503 is set to be ignored (cherry picked from commit 0fe98e1)
…e W504 (ros-infrastructure#636) * format_map is python 3.2 or later only (see also ros-infrastructure#602) * Ignore new pycodestyle rule W504 Was introduced in PyCQA/pycodestyle#502 it seems. Makes travis on master fail https://travis-ci.org/ros-infrastructure/rosdep/jobs/445522297
See also: PyCQA/pycodestyle/pull/502
* W503 is in conflict with the more modern W504 See PyCQA/pycodestyle#502 Change-Id: I1f29b362e0f0c6893a81c5cd12a862890e8d8609
We use quite old pep8 v1.6.2 which in particular misses this change PyCQA/pycodestyle#502 Let's update Dockerfile to use pycodestyle(former pep8) from bullseye. Change-Id: Id29acd80be212cffa127550d9a4deb764a5b5b30
We use quite old pep8 v1.6.2 which in particular misses this change PyCQA/pycodestyle#502 Let's update Dockerfile to use pycodestyle(former pep8) from bullseye. Change-Id: Id29acd80be212cffa127550d9a4deb764a5b5b30 (cherry picked from commit d552f2c0c2bbb8c802aa29ac9c23ed4c12d5a1cc) (cherry picked from commit ae28060)
We use quite old pep8 v1.6.2 which in particular misses this change PyCQA/pycodestyle#502 Let's update Dockerfile to use pycodestyle(former pep8) from bullseye. Change-Id: Id29acd80be212cffa127550d9a4deb764a5b5b30 (cherry picked from commit d552f2c0c2bbb8c802aa29ac9c23ed4c12d5a1cc)
This flips the W503 rule to enforce line breaks before binary operators.
Related #498
TODO: