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

Enable PyBetter's FixTrivialNestedWiths when Black improves multiple context manager formatting #17

Closed
Zac-HD opened this issue May 20, 2021 · 1 comment · Fixed by #91

Comments

@Zac-HD
Copy link
Owner

Zac-HD commented May 20, 2021

psf/black#664 proposes breaking very long with-statements using backslashes (< 3.9) or parentheses (>= 3.9), and shows the ugly current formatting for such statements.

Once that's done, re-enabling FixTrivialNestedWiths will be an obvious win. If Black initially only supports parenthesised context managers we can re-enable this refactoring for py39+ only.

@Zac-HD
Copy link
Owner Author

Zac-HD commented Feb 1, 2023

Thanks to psf/black#3489, this now works on Python 3.9 and later. I propose that shed --refactor should follow suit.

Python 3.7 will reach end of life before psf/black#3484 ships (black == 24.1.0 at earliest), but we can enable this feature for 3.8 if Black ships it before 3.8 reaches EOL too.

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

1 participant