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

[WIP] Add new formatter that can do better pretty-printing #7011

Closed
wants to merge 17 commits into from

Conversation

joshuawarner32
Copy link
Collaborator

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!

@kdziamura
Copy link
Collaborator

Related issue: #6903

Copy link

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 Closed are not deleted, so no matter what, the PR will still be right here in the repo. You can always access it and reopen it anytime you like!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants