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

ssort reformats dummy classes (conflict with black 24) #113

Closed
slafs opened this issue Jan 29, 2024 · 2 comments · Fixed by #114
Closed

ssort reformats dummy classes (conflict with black 24) #113

slafs opened this issue Jan 29, 2024 · 2 comments · Fixed by #114
Labels
bug Something isn't working

Comments

@slafs
Copy link

slafs commented Jan 29, 2024

In black v24 a few new rules become stable.
One of them is

Dummy class and function implementations consisting only of ... are formatted more compactly (#3796)

Most of the dummy bodies adjustment black makes are fine with ssort,
but a dummy class isn't.

Consider this simple file:

class MyException(Exception):
    ...

black v24 now re-formats it as:

class MyException(Exception): ...

while ssort re-formats it back to the original "shape".

I think this is a bug on ssort side.

We have both ssort and black configured in our pre-commit setup
and now we're unable to use them together.

@slafs slafs changed the title ssort insists on reformatting dummy classes (conflict with black 24) ssort reformats dummy classes (conflict with black 24) Jan 29, 2024
@bwhmather
Copy link
Owner

This certainly breaks our "if code is ordered correctly then it won't be changed rule".

@bwhmather
Copy link
Owner

Thank you for reporting. Have published a fix in 0.12.4.

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 a pull request may close this issue.

2 participants