Remove superfluous periods from pub --help subcommand descriptions. (#106925)
* Remove periods from pub --help command descriptions * Add trailing period consistently * Remove added period from PackagesInteractiveGetCommand description * Verify line ending for first line of command description * Update _allowedTrailingPatterns to validate that lines end with only one period, bang, or colon
This commit is contained in:
@@ -85,6 +85,10 @@ void verifyCommandRunner(CommandRunner<Object> runner) {
|
||||
void verifyCommand(Command<Object> runner) {
|
||||
expect(runner.argParser, isNotNull, reason: 'command ${runner.name} has no argParser');
|
||||
verifyOptions(runner.name, runner.argParser.options.values);
|
||||
|
||||
final String firstDescriptionLine = runner.description.split('\n').first;
|
||||
expect(firstDescriptionLine, matches(_allowedTrailingPatterns), reason: "command ${runner.name}'s description does not end with the expected single period that a full sentence should end with");
|
||||
|
||||
if (runner.hidden == false && runner.parent == null) {
|
||||
expect(
|
||||
runner.category,
|
||||
@@ -107,7 +111,7 @@ final RegExp _bannedArgumentNamePattern = RegExp(r'-uri$');
|
||||
|
||||
// Patterns for help messages.
|
||||
final RegExp _bannedLeadingPatterns = RegExp(r'^[-a-z]', multiLine: true);
|
||||
final RegExp _allowedTrailingPatterns = RegExp(r'([^ ][.!:]\)?|: https?://[^ ]+[^.]|^)$');
|
||||
final RegExp _allowedTrailingPatterns = RegExp(r'([^ ]([^.^!^:][.!:])\)?|: https?://[^ ]+[^.]|^)$');
|
||||
final RegExp _bannedQuotePatterns = RegExp(r" '|' |'\.|\('|'\)|`");
|
||||
final RegExp _bannedArgumentReferencePatterns = RegExp(r'[^"=]--[^ ]');
|
||||
final RegExp _questionablePatterns = RegExp(r'[a-z]\.[A-Z]');
|
||||
|
||||
Reference in New Issue
Block a user