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

Remove the old CLI options and executables. #1565

Merged
merged 2 commits into from
Sep 11, 2024
Merged

Remove the old CLI options and executables. #1565

merged 2 commits into from
Sep 11, 2024

Conversation

munificent
Copy link
Member

@munificent munificent commented Sep 11, 2024

Before the dart format command was added to the core Dart SDK, users accessed the formatter by running a separate dartfmt executable that was included with the Dart SDK. That executable had a different CLI interface. For example, you had to pass -w to get it to overwrite files and if you passed no arguments at all, it silently sat there waiting for input on stdin. When we added dart format, we took that opportunity to revamp the CLI options.

However, the dart_style package still exposed an executable with the old CLI. If you ran dart pub global activate dart_style, this would give you a dartfmt (and dartformat) executable with the old CLI options. Now that almost everyone is using dart format, we have removed the old CLI and the old package executables.

You can still run the formatter on the CLI through the package (for example, if you want to use a particular version of dart_style instead of the one bundled with your Dart SDK). But it now uses the exact same CLI options and arguments as the dart format command. You can invoke it with dart run dart_style:format <args...>.

Before the `dart format` command was added to the core Dart SDK, users accessed the formatter by running a separate `dartfmt` executable that was included with the Dart SDK. That executable had a different CLI interface. For example, you had to pass `-w` to get it to overwrite files and if you passed no arguments at all, it silently sat there waiting for input on stdin. When we added `dart format`, we took that opportunity to revamp the CLI options.

However, the dart_style package still exposed an executable with the old CLI. If you ran `dart pub global activate dart_style`, this would give you a `dartfmt` (and `dartformat`) executable with the old CLI options. Now that almost everyone is using `dart format`, we have removed the old CLI and the old package executables.

You can still run the formatter on the CLI through the package (for example, if you want to use a particular version of dart_style instead of the one bundled with your Dart SDK). But it now uses the exact same CLI options and arguments as the `dart format` command. You can invoke it with `dart run dart_style:format <args...>`.
Copy link
Member

@natebosch natebosch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I assume this will need some coordinate to roll in to the SDK?

@munificent
Copy link
Member Author

This actually shouldn't affect the SDK at all. The SDK is already using newer CLI and the newer DartFormatCommand class. This is just removing the old stuff that you can only access directly through the dart_style package's own CLI.

# Conflicts:
#	CHANGELOG.md
#	bin/format.dart
#	lib/src/cli/options.dart
#	test/cli_test.dart
#	test/command_line_test.dart
@munificent munificent merged commit 49832b6 into main Sep 11, 2024
7 checks passed
@munificent munificent deleted the remove-old-cli branch September 11, 2024 21:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants