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

feat(python): Config for Trailing Commas in Iterable Types #5486

Merged
merged 4 commits into from
Dec 26, 2024

Conversation

noanflaherty
Copy link
Collaborator

Description

Sometimes you may want to intentionally end an iterable with a trailing comma, such that black formats each item in the iterable to live in its own line of code. This PR introduces this functionality.

Changes Made

  • Add an optional config to all iterable types
  • Add test cases
  • Fix a bug for tuples containing a single element – they should always have a trailing comma

Testing

  • Unit tests added/updated

@noanflaherty noanflaherty requested review from amckinney and removed request for dsinghvi December 26, 2024 19:18
@noanflaherty noanflaherty changed the title feature(python): Config for Trailing Commas in Iterable Types feat(python): Config for Trailing Commas in Iterable Types Dec 26, 2024
@noanflaherty noanflaherty merged commit 82c9d11 into main Dec 26, 2024
49 of 50 checks passed
@noanflaherty noanflaherty deleted the noa/iterable-config branch December 26, 2024 21:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants