-
Notifications
You must be signed in to change notification settings - Fork 5.3k
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
feat(fmt): support YAML #24717
feat(fmt): support YAML #24717
Conversation
print_width: options.line_width.unwrap_or(80) as usize, | ||
use_tabs: options.use_tabs.unwrap_or_default(), | ||
indent_width: options.indent_width.unwrap_or(2) as usize, | ||
line_break: LineBreak::Lf, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
line_break: LineBreak::Lf, | |
..Default::default() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See #24717 (comment)
It's explicit so the defaults don't ever change in Deno.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had overlooked it 🙇
Yes, please! This would be a fantastic addition. @dsherret also mentioned that you have an HTML formatter. We would be interested in integrating them all. |
I just checked and this PR increases binary size on mac by about 200Kb:
|
20 bps is not nothing... I wonder how much the html or css formatters would add. |
We shouldn't just focus on increased size. Instead, we should consider "Is the increased size worth solving problems?". The original issue was opened three years ago and received some upvotes. Meanwhile, the first version of Pretty YAML is released about one month ago, but its dprint plugin has been downloaded nearly 6000 times. |
@g-plane we're on the same page. Given the size increase of the YAML formatter we're feeling optimistic about CSS and HTML formatters. Would you be able to open PRs for them as well? |
Considering that it may have merge conflicts with this PR, when should I do? Should I wait for this PR? And, recently I'm working on some optimizations (not size-related) on CSS formatter, so it may happen several days later, at least. |
Good point! We're discussing if we'd like to add unstable flags for the formatters (eg. Let's wait with other PR until after this one is merged. We're quite interested in having YAML, CSS and HTML formatters shipped in Deno v1.46 so just let me know if we can help with any of the PRs. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
This PR will close #12217 which is a feature request that is asked nearly three years ago!
A question not related to this: I've also made a dprint plugin that can format CSS, Sass, SCSS and Less, and it's written in Rust. Can we consider integrating it to "deno fmt"?