From 04bb2ac41834eae001372388fc5a3b7a1e56e394 Mon Sep 17 00:00:00 2001 From: stuartmorgan Date: Wed, 21 Jun 2023 16:28:09 -0400 Subject: [PATCH] [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. --- script/tool/lib/src/format_command.dart | 6 +++--- script/tool/test/format_command_test.dart | 3 +++ 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/script/tool/lib/src/format_command.dart b/script/tool/lib/src/format_command.dart index 36fd063b2b..30a5565f23 100644 --- a/script/tool/lib/src/format_command.dart +++ b/script/tool/lib/src/format_command.dart @@ -104,9 +104,9 @@ class FormatCommand extends PackageCommand { print('These files are not formatted correctly (see diff below):'); LineSplitter.split(stdout).map((String line) => ' $line').forEach(print); - print('\nTo fix run "dart pub global activate flutter_plugin_tools && ' - 'dart pub global run flutter_plugin_tools format" or copy-paste ' - 'this command into your terminal:'); + print('\nTo fix run the repository tooling `format` command: ' + 'https://github.com/flutter/packages/blob/main/script/tool/README.md#format-code\n' + 'or copy-paste this command into your terminal:'); final io.ProcessResult diff = await processRunner.run( 'git', diff --git a/script/tool/test/format_command_test.dart b/script/tool/test/format_command_test.dart index 546be9289f..86c3ffb0cc 100644 --- a/script/tool/test/format_command_test.dart +++ b/script/tool/test/format_command_test.dart @@ -512,6 +512,9 @@ void main() { containsAllInOrder([ contains('These files are not formatted correctly'), contains(changedFilePath), + // Ensure the error message links to instructions. + contains( + 'https://github.com/flutter/packages/blob/main/script/tool/README.md#format-code'), contains('patch -p1 <