Skip to content

Commit 86b1168

Browse files
authored
[repo] Adjust error message layout for repo checks (flutter#5241)
This tweaks the errors messages that provide info like how to override a repo check for versioning or changelog updates. Basically added newlines, so the errors do not require scrolling far off to the right to get the message.
1 parent 0e4e078 commit 86b1168

File tree

2 files changed

+17
-13
lines changed

2 files changed

+17
-13
lines changed

script/tool/lib/src/version_check_command.dart

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -558,11 +558,12 @@ ${indentation}The first version listed in CHANGELOG.md is $fromChangeLog.
558558
} else {
559559
printError(
560560
'No version change found, but the change to this package could '
561-
'not be verified to be exempt from version changes according to '
562-
'repository policy. If this is a false positive, please comment in '
563-
'the PR to explain why the PR is exempt, and add (or ask your '
564-
'reviewer to add) the "$_missingVersionChangeOverrideLabel" '
565-
'label.');
561+
'not be verified to be exempt\n'
562+
'from version changes according to repository policy.\n'
563+
'If this is a false positive, please comment in '
564+
'the PR to explain why the PR\n'
565+
'is exempt, and add (or ask your reviewer to add) the '
566+
'"$_missingVersionChangeOverrideLabel" label.');
566567
return 'Missing version change';
567568
}
568569
}
@@ -572,13 +573,13 @@ ${indentation}The first version listed in CHANGELOG.md is $fromChangeLog.
572573
logWarning('Ignoring lack of CHANGELOG update due to the '
573574
'"$_missingChangelogChangeOverrideLabel" label.');
574575
} else {
575-
printError(
576-
'No CHANGELOG change found. If this PR needs an exemption from '
577-
'the standard policy of listing all changes in the CHANGELOG, '
576+
printError('No CHANGELOG change found.\n'
577+
'If this PR needs an exemption from the standard policy of listing '
578+
'all changes in the CHANGELOG,\n'
578579
'comment in the PR to explain why the PR is exempt, and add (or '
579-
'ask your reviewer to add) the '
580-
'"$_missingChangelogChangeOverrideLabel" label. Otherwise, '
581-
'please add a NEXT entry in the CHANGELOG as described in '
580+
'ask your reviewer to add) the\n'
581+
'"$_missingChangelogChangeOverrideLabel" label.\n'
582+
'Otherwise, please add a NEXT entry in the CHANGELOG as described in '
582583
'the contributing guide.');
583584
return 'Missing CHANGELOG change';
584585
}

script/tool/test/version_check_command_test.dart

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -961,7 +961,7 @@ packages/plugin/example/lib/foo.dart
961961
expect(
962962
output,
963963
containsAllInOrder(<Matcher>[
964-
contains('No CHANGELOG change found'),
964+
contains('No CHANGELOG change found.\nIf'),
965965
contains('plugin:\n'
966966
' Missing CHANGELOG change'),
967967
]),
@@ -1222,7 +1222,10 @@ packages/plugin/lib/plugin.dart
12221222
expect(
12231223
output,
12241224
containsAllInOrder(<Matcher>[
1225-
contains('No version change found'),
1225+
contains(
1226+
'No version change found, but the change to this package could '
1227+
'not be verified to be exempt\n',
1228+
),
12261229
contains('plugin:\n'
12271230
' Missing version change'),
12281231
]),

0 commit comments

Comments
 (0)