Skip to content
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

Black and pycodestyle disagree about whitespace before : #354

Closed
dmerejkowsky opened this issue Jun 15, 2018 · 5 comments
Closed

Black and pycodestyle disagree about whitespace before : #354

dmerejkowsky opened this issue Jun 15, 2018 · 5 comments

Comments

@dmerejkowsky
Copy link
Contributor

Operating system: Debian 9
Python version: python 3.6
Black version: 18.6b2
Does also happen on master: yes

Steps to reproduce:

# in foo.py 
a[len(b) :]
$ black --diff foo.py
All done! ✨ 🍰 ✨
1 file left unchanged.
$ pycodestyle foo.py
foo.py:1:9: E203 whitespace before ':'

This is unfortunate because I use pycodestyle for CI (not everyone can/want use to black yet), but I use black in my editor to format on save ...

Of course, a workaround is to use # fmt: off, but I still think this is a bug in black and should be fixed.

@JelleZijlstra
Copy link
Collaborator

pycodestyle is breaking PEP 8 here; see https://github.com/ambv/black#slices.

@ambv
Copy link
Collaborator

ambv commented Jun 15, 2018

Turn off E203 and W503 and you can continue to use Black and pycodestyle.

@ambv ambv closed this as completed Jun 15, 2018
@dmerejkowsky
Copy link
Contributor Author

pycodestyle is breaking PEP 8 here

Woops, my bad. Sorry for the noise

gustavgransbo pushed a commit to gustavgransbo/gustavgrad that referenced this issue Jun 18, 2020
@simonwiles
Copy link

For future readers (including, no doubt, me the next time I forget), @JelleZijlstra's link is now https://black.readthedocs.io/en/stable/the_black_code_style.html#slices.

hunterhector added a commit to hunterhector/forte that referenced this issue Jun 23, 2021
hunterhector added a commit to asyml/forte that referenced this issue Jun 23, 2021
* Some dev

* Various bug fixes

* black formatting

* retry build

* Prior version of python use different import_lib resource

* black formatting

* pylint

* black

* Fix mypy

* Ignore flake8 E203,W503 to work with black.

See psf/black#354

* unused import

* fix method
@antgel
Copy link

antgel commented Oct 17, 2021

That link in 2021: https://black.readthedocs.io/en/stable/the_black_code_style/current_style.html#slices

Well, it is beta... ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants