Skip to content

Fix literal wrapping with black profile#2535

Open
paulkagiri wants to merge 1 commit intoPyCQA:mainfrom
paulkagiri:fix-literal-black-profile-wrapping
Open

Fix literal wrapping with black profile#2535
paulkagiri wants to merge 1 commit intoPyCQA:mainfrom
paulkagiri:fix-literal-black-profile-wrapping

Conversation

@paulkagiri
Copy link
Copy Markdown

Summary

  • account for the assignment prefix when formatting sorted literals
  • use vertical hanging wrapping with trailing commas for black-style literal sorting
  • add regression coverage for tuple sorting with the black profile

Fixes #1815

Tests

  • python -m pytest tests/unit/test_literal.py -q
  • python -m black --target-version py312 --check isort/literal.py tests/unit/test_literal.py
  • python -m ruff check isort/literal.py tests/unit/test_literal.py
  • git diff --check

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

Successfully merging this pull request may close these issues.

Tuple sorting doesn't consider profile

1 participant