Skip to content

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

Merged
MichaReiser merged 1 commit into
mainfrom
e203-tuple-whitespace
Feb 26, 2024
Merged

E203: Don't warn about single whitespace before tuple ,#10094
MichaReiser merged 1 commit into
mainfrom
e203-tuple-whitespace

Conversation

@MichaReiser
Copy link
Copy Markdown
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
@github-actions
Copy link
Copy Markdown
Contributor

ruff-ecosystem results

Linter (stable)

✅ ecosystem check detected no linter changes.

Linter (preview)

✅ ecosystem check detected no linter changes.

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