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 breaks flake8's E203 by adding space in slicing expression #1343

Closed
choucavalier opened this issue Apr 11, 2020 · 2 comments
Closed

Black breaks flake8's E203 by adding space in slicing expression #1343

choucavalier opened this issue Apr 11, 2020 · 2 comments
Labels
T: bug Something isn't working

Comments

@choucavalier
Copy link

Describe the bug A clear and concise description of what the bug is.

The following code

processed = ""
splits = [1, 2]
lines = ["test", "test", "test"]
processed += "".join(lines[splits[-1]:])

is reformated by black as

processed = ""
splits = [1, 2]
lines = ["test", "test", "test"]
processed += "".join(lines[splits[-1] :])

where a space is added in lines[splits[-1] :].

This breaks flake8

To Reproduce Steps to reproduce the behavior:

Just apply black to a Python file containing what I showed above

Expected behavior A clear and concise description of what you expected to happen.

I expect black to respect E203

Environment (please complete the following information):

  • Version: master (959848c)
  • OS and Python version: macOS 10.15.4, Python 3.7.6

Does this bug also happen on master? To answer this, you have two options:

Yes, tested on master (959848c)

@choucavalier choucavalier added the T: bug Something isn't working label Apr 11, 2020
@hugovk
Copy link
Contributor

hugovk commented Apr 11, 2020

@choucavalier
Copy link
Author

I see, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T: bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants