mirror of
https://github.com/flutter/packages.git
synced 2025-06-29 14:18:54 +08:00
[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.
This commit is contained in:
@ -104,9 +104,9 @@ class FormatCommand extends PackageCommand {
|
|||||||
print('These files are not formatted correctly (see diff below):');
|
print('These files are not formatted correctly (see diff below):');
|
||||||
LineSplitter.split(stdout).map((String line) => ' $line').forEach(print);
|
LineSplitter.split(stdout).map((String line) => ' $line').forEach(print);
|
||||||
|
|
||||||
print('\nTo fix run "dart pub global activate flutter_plugin_tools && '
|
print('\nTo fix run the repository tooling `format` command: '
|
||||||
'dart pub global run flutter_plugin_tools format" or copy-paste '
|
'https://github.com/flutter/packages/blob/main/script/tool/README.md#format-code\n'
|
||||||
'this command into your terminal:');
|
'or copy-paste this command into your terminal:');
|
||||||
|
|
||||||
final io.ProcessResult diff = await processRunner.run(
|
final io.ProcessResult diff = await processRunner.run(
|
||||||
'git',
|
'git',
|
||||||
|
@ -512,6 +512,9 @@ void main() {
|
|||||||
containsAllInOrder(<Matcher>[
|
containsAllInOrder(<Matcher>[
|
||||||
contains('These files are not formatted correctly'),
|
contains('These files are not formatted correctly'),
|
||||||
contains(changedFilePath),
|
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 <<DONE'),
|
contains('patch -p1 <<DONE'),
|
||||||
]));
|
]));
|
||||||
});
|
});
|
||||||
|
Reference in New Issue
Block a user