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

Changes to /tools/dart-format for new formatter #6222

Open
munificent opened this issue Nov 19, 2024 · 0 comments
Open

Changes to /tools/dart-format for new formatter #6222

munificent opened this issue Nov 19, 2024 · 0 comments
Assignees
Labels
a.articles Relates to articles written on topics in Dart

Comments

@munificent
Copy link
Member

munificent commented Nov 19, 2024

Describe the problem

There are a few changes to /tools/dart-format that we'll probably want to make because of the new formatting style that's coming out in 3.7. They are:

Expected fix

If you specify a directory, dart format affects only the files in the immediate directory; it doesn't recurse through subdirectories.

Uh, that's actually never been true. 🙃 If you pass a directory path, it recurses into its subdirectories as well. (Otherwise dart format . wouldn't do anything very useful since almost all of your Dart files are in lib/, bin/, etc.)

Use trailing commas

We should delete this entire section. With the new style, it adds and removes trailing commas on your behalf, and you basically always get the style that explicit trailing commas would give you before.

Affects whitespace only

Technically, it will now also make some non-whitespace changes because it will add and remove trailing commas, and may move a comment before or after a comma.

I don't know if that's splitting hairs or not, but if we want to be completely accurate, it would be good to re-word this or maybe just remove this section.

@munificent munificent added the a.articles Relates to articles written on topics in Dart label Nov 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a.articles Relates to articles written on topics in Dart
Projects
None yet
Development

No branches or pull requests

2 participants