-
Notifications
You must be signed in to change notification settings - Fork 26.8k
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
Formatter for Flutter (or, tree-aware code) #2025
Comments
@Hixie do you have a list/doc of specific wishes for a Flutter formatter? |
I think dart-lang/dart_style#442 is the main list right now. |
See also #4509 which talks about formatting the codelab. |
@abarth is the work you did on this available? |
Note that these days
|
Does
I count over 9000 occurrences of this in our repo, about 1800 in packages/flutter. |
It does something that IMHO is less readable than our style. (removes the newline and wraps) |
I think I'm going to file a new bug that more clearly states our goal. We just want automated formatting for Flutter, that doesn't make us feel like we're compromising too far from our readability goals expressed in our style guide. |
I'd be more specific: "We just want automated formatting for Flutter's SDK code, which is distinct from the code our users will write" This issue is written from the perspective of our users: they want formatting of tree-related code, often found in build() methods. We have that now, with trailing commas. I believe we can close this issue, and open two issues if they don't exist:
|
Is the final plan to use |
No, that's not sufficient yet. |
Hello, any update on this? I would love to be able to call |
Any update on this? |
Hi, I plan to contribute to Flutter in the coming weeks for the first time. Is there some configuration I can set in my editor to format according to the official guidelines? If not, what process do developers on the Flutter team follow to format their code? |
Hi, we currently format "by hand". It's not too far off from what the formatter does, save for a few things such as alignment and (not) wrapping lines for readibility. @eseidelGoogle Did you file the issue you mentioned in #2025 (comment)? |
@munificent can we consider this done with your formatter re-work? |
Well, the new formatter isn't done yet (dart-lang/dart_style#1403), but once it is, yes, I think it will qualify as addressing this. :) |
Excited! |
Not as excited as I am to see you back on Flutter! :D |
dartfmt is a really great utility, but it doesn't know about code that is trying to represent a tree. Which, is what Flutter does a lot of :)
We would like an automatic formatter that knows that Flutter code has a lot of tree-like structures, and retains a formatting style that makes tree-like structures easy to read.
Ideally, we'd then use this formatter in our CLI and Atom tools.
The text was updated successfully, but these errors were encountered: