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

E203: Don't warn about single whitespace before tuple , #10094

Merged
merged 1 commit into from
Feb 26, 2024

Conversation

MichaReiser
Copy link
Member

Summary

Fixes #10041

This PR fixes an issue in the E203 rule where it disallowed whitespace before a : if the : was directly followed by a ,:

ham[lower + 1 :, "columnname"]

This conflicts with our formatter because it inserts a whitespace before the : for all non simple expressions.

dataframe.loc[index + 1 :, "columnname"]
dataframe.loc[index + 1 :]

This PR allows the whitespace before the colon if what follows after is a ,, the same as we already do today if the colon is directly followed by a ].

Test Plan

Added test

@MichaReiser MichaReiser added the bug Something isn't working label Feb 23, 2024
@MichaReiser MichaReiser force-pushed the e203-tuple-whitespace branch from 80ac3d4 to d068e8f Compare February 23, 2024 10:06
Copy link
Contributor

ruff-ecosystem results

Linter (stable)

✅ ecosystem check detected no linter changes.

Linter (preview)

✅ ecosystem check detected no linter changes.

@MichaReiser MichaReiser merged commit 15b87ea into main Feb 26, 2024
17 checks passed
@MichaReiser MichaReiser deleted the e203-tuple-whitespace branch February 26, 2024 17:22
nkxxll pushed a commit to nkxxll/ruff that referenced this pull request Mar 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

E203: conflicts with formatter
2 participants