From abe6d57d6a67fea09dc5df08208b70f0bb772884 Mon Sep 17 00:00:00 2001 From: Kate Lovett Date: Thu, 26 Oct 2023 18:34:56 -0500 Subject: [PATCH 1/2] Tweak error message --- .../tool/lib/src/version_check_command.dart | 32 +++++++++---------- .../tool/test/version_check_command_test.dart | 7 ++-- 2 files changed, 21 insertions(+), 18 deletions(-) diff --git a/script/tool/lib/src/version_check_command.dart b/script/tool/lib/src/version_check_command.dart index c27a1ad33c44..7720e2a3db2f 100644 --- a/script/tool/lib/src/version_check_command.dart +++ b/script/tool/lib/src/version_check_command.dart @@ -442,11 +442,10 @@ ${indentation}HTTP response: ${pubVersionFinderResponse.httpResponse.body} } if (fromPubspec != fromChangeLog) { - printError(''' -${indentation}Versions in CHANGELOG.md and pubspec.yaml do not match. -${indentation}The version in pubspec.yaml is $fromPubspec. -${indentation}The first version listed in CHANGELOG.md is $fromChangeLog. -'''); + printError( + '${indentation}Versions in CHANGELOG.md and pubspec.yaml do not match.\n ' + '${indentation}The version in pubspec.yaml is $fromPubspec.\n ' + '${indentation}The first version listed in CHANGELOG.md is $fromChangeLog.'); return false; } @@ -558,11 +557,12 @@ ${indentation}The first version listed in CHANGELOG.md is $fromChangeLog. } else { printError( 'No version change found, but the change to this package could ' - 'not be verified to be exempt from version changes according to ' - 'repository policy. If this is a false positive, please comment in ' - 'the PR to explain why the PR is exempt, and add (or ask your ' - 'reviewer to add) the "$_missingVersionChangeOverrideLabel" ' - 'label.'); + 'not be verified to be exempt\n' + 'from version changes according to repository policy.\n' + 'If this is a false positive, please comment in ' + 'the PR to explain why the PR\n' + 'is exempt, and add (or ask your reviewer to add) the ' + '"$_missingVersionChangeOverrideLabel" label.'); return 'Missing version change'; } } @@ -572,13 +572,13 @@ ${indentation}The first version listed in CHANGELOG.md is $fromChangeLog. logWarning('Ignoring lack of CHANGELOG update due to the ' '"$_missingChangelogChangeOverrideLabel" label.'); } else { - printError( - 'No CHANGELOG change found. If this PR needs an exemption from ' - 'the standard policy of listing all changes in the CHANGELOG, ' + printError('No CHANGELOG change found.\n' + 'If this PR needs an exemption from the standard policy of listing ' + 'all changes in the CHANGELOG,\n' 'comment in the PR to explain why the PR is exempt, and add (or ' - 'ask your reviewer to add) the ' - '"$_missingChangelogChangeOverrideLabel" label. Otherwise, ' - 'please add a NEXT entry in the CHANGELOG as described in ' + 'ask your reviewer to add) the\n' + '"$_missingChangelogChangeOverrideLabel" label.\n' + 'Otherwise, please add a NEXT entry in the CHANGELOG as described in ' 'the contributing guide.'); return 'Missing CHANGELOG change'; } diff --git a/script/tool/test/version_check_command_test.dart b/script/tool/test/version_check_command_test.dart index da864de409a9..13bee57785c0 100644 --- a/script/tool/test/version_check_command_test.dart +++ b/script/tool/test/version_check_command_test.dart @@ -961,7 +961,7 @@ packages/plugin/example/lib/foo.dart expect( output, containsAllInOrder([ - contains('No CHANGELOG change found'), + contains('No CHANGELOG change found.\nIf'), contains('plugin:\n' ' Missing CHANGELOG change'), ]), @@ -1222,7 +1222,10 @@ packages/plugin/lib/plugin.dart expect( output, containsAllInOrder([ - contains('No version change found'), + contains( + 'No version change found, but the change to this package could ' + 'not be verified to be exempt\n', + ), contains('plugin:\n' ' Missing version change'), ]), From b61d09e31f7e653a64cad96747821b1236010a67 Mon Sep 17 00:00:00 2001 From: Kate Lovett Date: Fri, 3 Nov 2023 15:38:35 -0500 Subject: [PATCH 2/2] Rollback over tweaking --- script/tool/lib/src/version_check_command.dart | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/script/tool/lib/src/version_check_command.dart b/script/tool/lib/src/version_check_command.dart index 7720e2a3db2f..81fa3eec5100 100644 --- a/script/tool/lib/src/version_check_command.dart +++ b/script/tool/lib/src/version_check_command.dart @@ -442,10 +442,11 @@ ${indentation}HTTP response: ${pubVersionFinderResponse.httpResponse.body} } if (fromPubspec != fromChangeLog) { - printError( - '${indentation}Versions in CHANGELOG.md and pubspec.yaml do not match.\n ' - '${indentation}The version in pubspec.yaml is $fromPubspec.\n ' - '${indentation}The first version listed in CHANGELOG.md is $fromChangeLog.'); + printError(''' +${indentation}Versions in CHANGELOG.md and pubspec.yaml do not match. +${indentation}The version in pubspec.yaml is $fromPubspec. +${indentation}The first version listed in CHANGELOG.md is $fromChangeLog. +'''); return false; }