Skip to content

Dart commands and Flutter commands are inconsistent #52747

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

Open
rrousselGit opened this issue Jun 21, 2023 · 5 comments
Open

Dart commands and Flutter commands are inconsistent #52747

rrousselGit opened this issue Jun 21, 2023 · 5 comments
Assignees
Labels
area-dart-cli Use area-dart-cli for issues related to the 'dart' command like tool.

Comments

@rrousselGit
Copy link

Hello!

This is an issue about how as a whole, while many commands are shared between dart cmd and flutter cmd, there are lots of inconsistencies.
This causes quite a bit of confusion because the tools are not strictly interchangeable. Someone used to one command with either dart or flutter will likely expect the variant in the other command to behave the same, when it doesn't.

Here's a non-exhaustive list of problems I found:

  • flutter analyze exits with 1 if infos are found, but dart analyze doesn't. So the former uses --no-fatal-infos, while the latter uses --fatal-infos.
  • flutter test --coverage generates a lcov file, yet dart test --coverage=dir expects a directory name and generates unintuitive JSON outputs (which doesn't work with VScode extensions such as Coverage Gutters)

Considering how both are maintained by Google, I think it would be valuable if the commands could be aligned to behave similarly.

@lrhn lrhn added the area-dart-cli Use area-dart-cli for issues related to the 'dart' command like tool. label Jun 21, 2023
@bkonyi bkonyi self-assigned this Jun 21, 2023
@bkonyi
Copy link
Contributor

bkonyi commented Jun 21, 2023

Thanks for the issue @rrousselGit! I agree, we could definitely be more consistent between our CLIs and that is something we'd like to do. I'll be sure to bring this up at our next CLI sync.

We've got lots of different teams working on the various commands, particularly for the Dart CLI, so if you (or anyone else) is aware of any other inconsistencies, please document them here so we can be made aware of them.

@rrousselGit
Copy link
Author

Great! I'll do my best listing those inconsistencies as they come back to mind.

Another one is:
dart pub run cmd recently got deprecated in favor of dart run cmd. Yet Flutter uses flutter pub run still, because flutter run is taken already (to start the flutter app).

@bkonyi
Copy link
Contributor

bkonyi commented Jun 21, 2023

Thanks Remi! It's greatly appreciated! :)

@bkonyi
Copy link
Contributor

bkonyi commented Jul 6, 2023

Related issue Using --define is not consistent across dart CLI commands: #51791

@brainwo
Copy link

brainwo commented Jul 13, 2023

There is also another inconsistency I found:

# automatically name the project as name_with_dash
dart create name-with-dash
# this isn't allowed
flutter create name-with-dash
# what you have to do
flutter create name-with-dash --project-name name_with_dash
$ flutter create name-with-dash
"name-with-dash" is not a valid Dart package name.

See https://dart.dev/tools/pub/pubspec#name for more information.

I usually name my repository with dashes instead of underscores

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-dart-cli Use area-dart-cli for issues related to the 'dart' command like tool.
Projects
None yet
Development

No branches or pull requests

4 participants