-
-
Notifications
You must be signed in to change notification settings - Fork 312
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
[WIP] Add new formatter that can do better pretty-printing #7011
Conversation
Related issue: #6903 |
Thank you for your contribution! Sometimes PRs end up staying open for a long time without activity, which can make the list of open PRs get long and time-consuming to review. To keep things manageable for reviewers, this bot automatically closes PRs that haven’t had activity in 60 days. This PR hasn’t had activity in 30 days, so it will be automatically closed if there is no more activity in the next 30 days. Keep in mind that PRs marked |
Instead of trying to do formatting all in one go, instead build up an efficient tree structure first and only after that decide where to place newlines/etc.
Notably, this let's us use relatively simple/clean heuristics for removing newlines as long as the overal visual line length remains manageable.
It also removes the need for separate is_multiline/format code, where the former has to infer what the latter will do.
Highly WIP! Not ready for merging!