Skip to content

Commit 04bb2ac

Browse files
[tools] Fix format instructions (#4259)
The instructions for `format` failures still referred to using `activate`, which is no longer how tools are invoked. Replace the specific instructions with a link to the relevant README section to make them evergreen.
1 parent 9af50d4 commit 04bb2ac

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

script/tool/lib/src/format_command.dart

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -104,9 +104,9 @@ class FormatCommand extends PackageCommand {
104104
print('These files are not formatted correctly (see diff below):');
105105
LineSplitter.split(stdout).map((String line) => ' $line').forEach(print);
106106

107-
print('\nTo fix run "dart pub global activate flutter_plugin_tools && '
108-
'dart pub global run flutter_plugin_tools format" or copy-paste '
109-
'this command into your terminal:');
107+
print('\nTo fix run the repository tooling `format` command: '
108+
'https://github.com/flutter/packages/blob/main/script/tool/README.md#format-code\n'
109+
'or copy-paste this command into your terminal:');
110110

111111
final io.ProcessResult diff = await processRunner.run(
112112
'git',

script/tool/test/format_command_test.dart

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -512,6 +512,9 @@ void main() {
512512
containsAllInOrder(<Matcher>[
513513
contains('These files are not formatted correctly'),
514514
contains(changedFilePath),
515+
// Ensure the error message links to instructions.
516+
contains(
517+
'https://github.com/flutter/packages/blob/main/script/tool/README.md#format-code'),
515518
contains('patch -p1 <<DONE'),
516519
]));
517520
});

0 commit comments

Comments
 (0)