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

Formatter: dummy_implementations preview style #8357

Closed
Tracked by #6935 ...
jab opened this issue Oct 30, 2023 · 2 comments · Fixed by #9240
Closed
Tracked by #6935 ...

Formatter: dummy_implementations preview style #8357

jab opened this issue Oct 30, 2023 · 2 comments · Fixed by #9240
Assignees
Labels
formatter Related to the formatter preview Related to preview mode features

Comments

@jab
Copy link
Contributor

jab commented Oct 30, 2023

Add support for Black's dummy_implementations preview style. It introduces new rules around blank lines. Violates E704 that Ruff does not implement.

See psf/black#3796 and referenced links. E.g. from psf/black#1797 (comment):

  • If the body of a class or function is just ..., put it on the same line directly after the colon
  • If multiple adjacent functions with the same name each have only ... as their body, remove the blank lines between them. (This would apply to overloads in practice, but avoids hardcoding behavior for the "overload" name.)

This task is a child of #6935. This is required for ruff to provide a drop-in replacement for black with the preview style.

@charliermarsh charliermarsh added formatter Related to the formatter preview Related to preview mode features labels Oct 30, 2023
@MichaReiser MichaReiser added this to the Formatter: Stable milestone Oct 31, 2023
jab added a commit to jab/bidict that referenced this issue Nov 1, 2023
Will actually switch once we can pick up the fix for
astral-sh/ruff#8357.
@zanieb
Copy link
Member

zanieb commented Nov 2, 2023

@jab would you mind updating the issue with some consolidated documentation about what this change entails and what motivates it? e.g. as in #8436

@MichaReiser
Copy link
Member

Part of this was implemented in #7440

@MichaReiser MichaReiser changed the title More concise formatting for dummy implementations Formatter: dummy_implementations preview style Nov 29, 2023
@MichaReiser MichaReiser self-assigned this Dec 22, 2023
@MichaReiser MichaReiser linked a pull request Dec 22, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
formatter Related to the formatter preview Related to preview mode features
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants