Skip to content

[flutter_tools] Deprecate flutter format sub-command in favor of dart format #115809

@christopherfujino

Description

@christopherfujino

The flutter format ... sub-command is essentially just a wrapper around a dart format ... sub-process call: https://github.com/flutter/flutter/blob/master/packages/flutter_tools/lib/src/commands/format.dart#L36. However, it still has bugs: #109553 which are non-trivial to work around. We should deprecate this flutter format, with a message directing users to migrate to directly using dart format.

Deprecation plan:

  • on Flutter's main branch, land a PR to add a deprecation warning to the flutter format sub-command, warning users that it will be removed in a future Flutter release and that all uses of it should be replaced by dart format with the same command line arguments
  • once the code from the previous step reaches a stable release, a new change can be made to main that fails with a non-zero exit code, again with directions to start using dart format. This will catch users who either did not see the deprecation warning or chose to ignore it.
  • once the code from the previous step reaches a stable release, the command can be deleted from main.

If at any point it is found that customers have a legitimate use of flutter format that cannot be trivially met by substituting dart format for flutter format, we can discuss reverting the change and restoring flutter format.

Metadata

Metadata

Labels

P1High-priority issues at the top of the work listc: proposalA detailed proposal for a change to FluttertoolAffects the "flutter" command-line tool. See also t: labels.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions