From 6f3b07811b5689bffa47f39d953e1ba544e1290b Mon Sep 17 00:00:00 2001 From: Christopher Fujino Date: Thu, 22 Jun 2023 14:28:55 -0700 Subject: [PATCH] [flutter_tools] delete flutter format command (#129360) On the current stable branch (3.10.x), `flutter format` no longer works, and gives an error. This change just deletes the code. Fixes https://github.com/flutter/flutter/issues/115809 --- packages/flutter_tools/lib/executable.dart | 2 - .../lib/src/commands/format.dart | 39 ------------------- 2 files changed, 41 deletions(-) delete mode 100644 packages/flutter_tools/lib/src/commands/format.dart diff --git a/packages/flutter_tools/lib/executable.dart b/packages/flutter_tools/lib/executable.dart index ab81912759..2fb826f17d 100644 --- a/packages/flutter_tools/lib/executable.dart +++ b/packages/flutter_tools/lib/executable.dart @@ -28,7 +28,6 @@ import 'src/commands/doctor.dart'; import 'src/commands/downgrade.dart'; import 'src/commands/drive.dart'; import 'src/commands/emulators.dart'; -import 'src/commands/format.dart'; import 'src/commands/generate.dart'; import 'src/commands/generate_localizations.dart'; import 'src/commands/ide_config.dart'; @@ -200,7 +199,6 @@ List generateCommands({ signals: globals.signals, ), EmulatorsCommand(), - FormatCommand(), GenerateCommand(), GenerateLocalizationsCommand( fileSystem: globals.fs, diff --git a/packages/flutter_tools/lib/src/commands/format.dart b/packages/flutter_tools/lib/src/commands/format.dart deleted file mode 100644 index c4ea165d14..0000000000 --- a/packages/flutter_tools/lib/src/commands/format.dart +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright 2014 The Flutter Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -import 'package:args/args.dart'; - -import '../base/common.dart'; -import '../runner/flutter_command.dart'; - -class FormatCommand extends FlutterCommand { - FormatCommand(); - - @override - ArgParser argParser = ArgParser.allowAnything(); - - @override - final String name = 'format'; - - @override - List get aliases => const ['dartfmt']; - - @override - String get description => deprecationWarning; - - @override - final bool hidden = true; - - @override - String get deprecationWarning { - return 'The "format" command is deprecated. Please use the "dart format" ' - 'sub-command instead, which has the same command-line usage as ' - '"flutter format".\n'; - } - - @override - Future runCommand() async { - throwToolExit(deprecationWarning); - } -}