Adhere to lines_longer_than_80_chars lint (#4340)

diff --git a/analysis_options.yaml b/analysis_options.yaml
index c820ffe..fb93ce7 100644
--- a/analysis_options.yaml
+++ b/analysis_options.yaml
@@ -2,7 +2,6 @@
 
 analyzer:
   errors:
-    lines_longer_than_80_chars: ignore # TODO(mosum): fix the offending lines
     todo: ignore
   exclude:
    - lib/src/third_party/**
diff --git a/lib/src/authentication/client.dart b/lib/src/authentication/client.dart
index 2b4e835..5d8fdaa 100644
--- a/lib/src/authentication/client.dart
+++ b/lib/src/authentication/client.dart
@@ -22,8 +22,8 @@
   /// Constructs Http client wrapper that injects `authorization` header to
   /// requests and handles authentication errors.
   ///
-  /// [_credential] might be `null`. In that case `authorization` header will not
-  /// be injected to requests.
+  /// [_credential] might be `null`. In that case `authorization` header will
+  /// not be injected to requests.
   _AuthenticatedClient(this._inner, this._credential);
 
   final http.BaseClient _inner;
diff --git a/lib/src/authentication/credential.dart b/lib/src/authentication/credential.dart
index 232ca5c..5e51754 100644
--- a/lib/src/authentication/credential.dart
+++ b/lib/src/authentication/credential.dart
@@ -101,9 +101,9 @@
   /// Environment variable name that stores token value
   final String? env;
 
-  /// Unknown fields found in pub-tokens.json. The fields might be created by the
-  /// future version of pub tool. We don't want to override them when using the
-  /// old SDK.
+  /// Unknown fields found in pub-tokens.json. The fields might be created by
+  /// the future version of pub tool. We don't want to override them when using
+  /// the old SDK.
   final Map<String, dynamic> unknownFields;
 
   /// Serializes [Credential] into json format.
diff --git a/lib/src/command.dart b/lib/src/command.dart
index 3014a1c..a703522 100644
--- a/lib/src/command.dart
+++ b/lib/src/command.dart
@@ -238,7 +238,8 @@
         }
         log.dumpTranscriptToFile(
           transcriptPath,
-          'dart pub ${_topCommand.argResults!.arguments.map(protectArgument).join(' ')}',
+          'dart pub '
+          '${_topCommand.argResults!.arguments.map(protectArgument).join(' ')}',
           e,
         );
 
diff --git a/lib/src/command/add.dart b/lib/src/command/add.dart
index 87ac45b..8282d2c 100644
--- a/lib/src/command/add.dart
+++ b/lib/src/command/add.dart
@@ -98,9 +98,12 @@
       hide: true,
     );
 
-    // Following options are hidden/deprecated in favor of the new syntax: [dev:]<package>[:descriptor] ...
-    // To avoid breaking changes we keep supporting them, but hide them from --help to discourage
-    // further use. Combining these with new syntax will fail.
+    // Following options are hidden/deprecated in favor of the new syntax:
+    // [dev:]<package>[:descriptor] ...
+    //
+    // To avoid breaking changes we keep supporting them, but hide them from
+    // --help to discourage further use. Combining these with new syntax will
+    // fail.
     argParser.addOption(
       'git-url',
       help: 'Git URL of the package',
@@ -229,7 +232,8 @@
       final resultPackage = solveResult.packages
           .firstWhere((packageId) => packageId.name == name);
 
-      /// Assert that [resultPackage] is within the original user's expectations.
+      /// Assert that [resultPackage] is within the original user's
+      /// expectations.
       final constraint = update.constraint;
       if (constraint != null && !constraint.allows(resultPackage.version)) {
         final dependencyOverrides = resolutionPubspec.dependencyOverrides;
@@ -333,7 +337,8 @@
     } else {
       if (dependencyNames.contains(name)) {
         log.message(
-          '"$name" is already in "dependencies". Will try to update the constraint.',
+          '"$name" is already in "dependencies". '
+          'Will try to update the constraint.',
         );
         dependencies.removeWhere((element) => element.name == name);
       }
@@ -503,7 +508,8 @@
       }
       if (couldParseAsNewStyle) {
         usageException(
-          '--dev, --path, --sdk, --git-url, --git-path and --git-ref cannot be combined with a descriptor.',
+          '--dev, --path, --sdk, --git-url, --git-path and --git-ref '
+          'cannot be combined with a descriptor.',
         );
       } else {
         usageException('Invalid version constraint: ${e.message}');
@@ -630,7 +636,8 @@
               },
             },
             cache.sources,
-            // Resolve relative paths relative to current, not where the pubspec.yaml is.
+            // Resolve relative paths relative to current, not where the
+            // pubspec.yaml is.
             containingDescription: RootDescription(p.current),
           );
         } on FormatException catch (e) {
@@ -717,7 +724,8 @@
       }
 
       /// Remove the package from dev_dependencies if we are adding it to
-      /// dependencies. Refer to [_addPackageToPubspec] for additional discussion.
+      /// dependencies. Refer to [_addPackageToPubspec] for additional
+      /// discussion.
       if (!update.isDev && !update.isOverride) {
         final devDependenciesNode = yamlEditor
             .parseAt(['dev_dependencies'], orElse: () => YamlScalar.wrap(null));
diff --git a/lib/src/command/cache_preload.dart b/lib/src/command/cache_preload.dart
index 0acb03c..c6a0149 100644
--- a/lib/src/command/cache_preload.dart
+++ b/lib/src/command/cache_preload.dart
@@ -21,8 +21,9 @@
   @override
   String get docUrl => 'https://dart.dev/tools/pub/cmd/pub-cache';
 
-  /// The `cache preload` command is hidden by default, because it's really only intended for
-  /// `flutter` to use when pre-loading `PUB_CACHE` after being installed from `zip` archive.
+  /// The `cache preload` command is hidden by default, because it's really only
+  /// intended for `flutter` to use when pre-loading `PUB_CACHE` after being
+  /// installed from `zip` archive.
   @override
   bool get hidden => true;
 
diff --git a/lib/src/command/cache_repair.dart b/lib/src/command/cache_repair.dart
index b617394..35d0840 100644
--- a/lib/src/command/cache_repair.dart
+++ b/lib/src/command/cache_repair.dart
@@ -46,7 +46,8 @@
     if (failures.isNotEmpty) {
       final packages = pluralize('package', failures.length);
       final buffer = StringBuffer(
-        'Failed to reinstall ${log.red(failures.length.toString())} $packages:\n',
+        'Failed to reinstall '
+        '${log.red(failures.length.toString())} $packages:\n',
       );
 
       for (var failure in failures) {
@@ -65,14 +66,16 @@
     if (repairSuccesses.isNotEmpty) {
       final packages = pluralize('package', repairSuccesses.length);
       log.message(
-        'Reactivated ${log.green(repairSuccesses.length.toString())} $packages.',
+        'Reactivated '
+        '${log.green(repairSuccesses.length.toString())} $packages.',
       );
     }
 
     if (repairFailures.isNotEmpty) {
       final packages = pluralize('package', repairFailures.length);
       log.message(
-        'Failed to reactivate ${log.red(repairFailures.length.toString())} $packages:',
+        'Failed to reactivate '
+        '${log.red(repairFailures.length.toString())} $packages:',
       );
       log.message(
         repairFailures.map((name) => '- ${log.bold(name)}').join('\n'),
diff --git a/lib/src/command/dependency_services.dart b/lib/src/command/dependency_services.dart
index ec8de3e..9ae3aee 100644
--- a/lib/src/command/dependency_services.dart
+++ b/lib/src/command/dependency_services.dart
@@ -38,8 +38,8 @@
   @override
   String get name => 'report';
   @override
-  String get description =>
-      'Output a machine-digestible report of the upgrade options for each dependency.';
+  String get description => 'Output a machine-digestible '
+      'report of the upgrade options for each dependency.';
   @override
   String get argumentsDescription => '[options]';
 
@@ -344,7 +344,8 @@
               );
             } else {
               fail(
-                'The dependency $targetPackage does not have a map or string as a description',
+                'The dependency $targetPackage does not have a '
+                'map or string as a description',
               );
             }
           } else if (targetVersion != null) {
@@ -409,7 +410,8 @@
           final versions = await cache.getVersions(updatedRef);
           if (versions.isEmpty) {
             dataError(
-              'Found no versions of $targetPackage with git revision `$targetRevision`.',
+              'Found no versions of $targetPackage '
+              'with git revision `$targetRevision`.',
             );
           }
           // GitSource can only return a single version.
@@ -427,7 +429,8 @@
             targetRevision == null &&
             !(lockFileYaml['packages'] as Map).containsKey(targetPackage)) {
           dataError(
-            'Trying to remove non-existing transitive dependency $targetPackage.',
+            'Trying to remove non-existing '
+            'transitive dependency $targetPackage.',
           );
         }
       }
@@ -472,7 +475,8 @@
             );
           }
         }
-        // Only if we originally had a lock-file we write the resulting lockfile back.
+        // Only if we originally had a lock-file we write the resulting lockfile
+        // back.
         if (updatedLockfile != null) {
           final updatedPackages = <PackageId>[];
           for (var package in solveResult.packages) {
@@ -595,7 +599,8 @@
 
 /// Return a constraint compatible with [newVersion].
 ///
-/// By convention if the original constraint is pinned we return [newVersion]. Otherwise use [VersionConstraint.compatibleWith].
+/// By convention if the original constraint is pinned we return [newVersion].
+/// Otherwise use [VersionConstraint.compatibleWith].
 VersionConstraint _bumpConstraint(
   VersionConstraint original,
   Version newVersion,
@@ -614,9 +619,11 @@
   );
 }
 
-/// Return a constraint compatible with [newVersion], but including [original] as well.
+/// Return a constraint compatible with [newVersion], but including [original]
+/// as well.
 ///
-/// By convention if the original constraint is pinned, we don't widen the constraint but return [newVersion] instead.
+/// By convention if the original constraint is pinned, we don't widen the
+/// constraint but return [newVersion] instead.
 VersionConstraint _widenConstraint(
   VersionConstraint original,
   Version newVersion,
diff --git a/lib/src/command/deps.dart b/lib/src/command/deps.dart
index 003aa89..212d541 100644
--- a/lib/src/command/deps.dart
+++ b/lib/src/command/deps.dart
@@ -78,12 +78,14 @@
     if (argResults.flag('json')) {
       if (argResults.wasParsed('dev')) {
         usageException(
-          'Cannot combine --json and --dev.\nThe json output contains the dependency type in the output.',
+          'Cannot combine --json and --dev.\n'
+          'The json output contains the dependency type in the output.',
         );
       }
       if (argResults.wasParsed('executables')) {
         usageException(
-          'Cannot combine --json and --executables.\nThe json output always lists available executables.',
+          'Cannot combine --json and --executables.\n'
+          'The json output always lists available executables.',
         );
       }
       if (argResults.wasParsed('style')) {
@@ -369,7 +371,8 @@
   String _labelPackage(Package package) =>
       '${log.bold(package.name)} ${package.version}';
 
-  /// Gets the names of the non-immediate dependencies of the workspace packages.
+  /// Gets the names of the non-immediate dependencies of the workspace
+  /// packages.
   Future<Set<String>> _getTransitiveDependencies() async {
     final transitive = await _getAllDependencies();
     for (final root in entrypoint.workspaceRoot.transitiveWorkspace) {
diff --git a/lib/src/command/get.dart b/lib/src/command/get.dart
index ce9ea76..bd2eadf 100644
--- a/lib/src/command/get.dart
+++ b/lib/src/command/get.dart
@@ -37,8 +37,8 @@
     argParser.addFlag(
       'enforce-lockfile',
       negatable: false,
-      help:
-          'Enforce pubspec.lock. Fail resolution if pubspec.lock does not satisfy pubspec.yaml',
+      help: 'Enforce pubspec.lock. '
+          'Fail resolution if pubspec.lock does not satisfy pubspec.yaml',
     );
 
     argParser.addFlag(
diff --git a/lib/src/command/global_activate.dart b/lib/src/command/global_activate.dart
index 3a2f0f9..c0a445d 100644
--- a/lib/src/command/global_activate.dart
+++ b/lib/src/command/global_activate.dart
@@ -73,8 +73,8 @@
     argParser.addOption(
       'hosted-url',
       abbr: 'u',
-      help:
-          'A custom pub server URL for the package. Only applies when using the `hosted` source.',
+      help: 'A custom pub server URL for the package. '
+          'Only applies when using the `hosted` source.',
     );
   }
 
@@ -115,7 +115,8 @@
         (argResults.option('git-path') != null ||
             argResults.option('git-ref') != null)) {
       usageException(
-        'Options `--git-path` and `--git-ref` can only be used with --source=git.',
+        'Options `--git-path` and `--git-ref` '
+        'can only be used with --source=git.',
       );
     }
 
@@ -156,7 +157,8 @@
 
         if (!packageNameRegExp.hasMatch(package)) {
           final suggestion = dirExists(package)
-              ? '\n\nDid you mean `$topLevelProgram pub global activate --source path ${escapeShellArgument(package)}`?'
+              ? '\n\nDid you mean `$topLevelProgram pub global activate '
+                  '--source path ${escapeShellArgument(package)}`?'
               : '';
 
           usageException('Not a valid package name: "$package"$suggestion');
diff --git a/lib/src/command/lish.dart b/lib/src/command/lish.dart
index 26638aa..5a8e4a7 100644
--- a/lib/src/command/lish.dart
+++ b/lib/src/command/lish.dart
@@ -94,8 +94,8 @@
     argParser.addFlag(
       'skip-validation',
       negatable: false,
-      help:
-          'Publish without validation and resolution (this will ignore errors).',
+      help: 'Publish without validation and resolution '
+          '(this will ignore errors).',
     );
     argParser.addOption(
       'server',
@@ -110,8 +110,8 @@
     );
     argParser.addOption(
       'from-archive',
-      help:
-          'Publish from a .tar.gz archive instead of current folder. Implies `--skip-validation`.',
+      help: 'Publish from a .tar.gz archive instead of current folder. '
+          'Implies `--skip-validation`.',
       valueHelp: '[archive.tar.gz]',
       hide: true,
     );
@@ -328,9 +328,13 @@
     // Show the package contents so the user can verify they look OK.
     final package = entrypoint.workPackage;
     final host = computeHost(package.pubspec);
+    final fileTree = tree.fromFiles(
+      filesAndEmptyDirs,
+      baseDir: entrypoint.workPackage.dir,
+      showFileSizes: true,
+    );
     log.message(
-      'Publishing ${package.name} ${package.version} to $host:\n'
-      '${tree.fromFiles(filesAndEmptyDirs, baseDir: entrypoint.workPackage.dir, showFileSizes: true)}',
+      'Publishing ${package.name} ${package.version} to $host:\n$fileTree',
     );
 
     final packageBytes = await createTarGz(
@@ -338,8 +342,9 @@
       baseDir: entrypoint.workPackage.dir,
     ).toBytes();
 
+    final size = _readableFileSize(packageBytes.length);
     log.message(
-      '\nTotal compressed archive size: ${_readableFileSize(packageBytes.length)}.\n',
+      '\nTotal compressed archive size: $size.\n',
     );
 
     final validationResult =
@@ -399,10 +404,10 @@
 
   /// Validates the package.
   ///
-  /// Throws if there are errors and the upload should not
-  /// proceed.
+  /// Throws if there are errors and the upload should not proceed.
   ///
-  /// Returns a summary of warnings and hints if there are any, otherwise `null`.
+  /// Returns a summary of warnings and hints if there are any, otherwise
+  /// `null`.
   Future<({int warningsCount, int hintsCount})> _validate(
     Uint8List packageBytes,
     List<String> files,
@@ -444,8 +449,8 @@
     log.message('\nPublishing is forever; packages cannot be unpublished.'
         '\nPolicy details are available at https://pub.dev/policy\n');
 
-    var message =
-        'Do you want to publish ${package.pubspec.name} ${package.pubspec.version} to $host';
+    var message = 'Do you want to publish '
+        '${package.pubspec.name} ${package.pubspec.version} to $host';
     if (package.hintCount != 0 || package.warningCount != 0) {
       message = '${package.warningsCountMessage}. $message';
     }
diff --git a/lib/src/command/login.dart b/lib/src/command/login.dart
index 97a553f..5b1311b 100644
--- a/lib/src/command/login.dart
+++ b/lib/src/command/login.dart
@@ -28,7 +28,8 @@
       final userInfo = await _retrieveUserInfo();
       if (userInfo == null) {
         log.warning('Could not retrieve your user-details.\n'
-            'You might have to run `$topLevelProgram pub logout` to delete your credentials and try again.');
+            'You might have to run `$topLevelProgram pub logout` '
+            'to delete your credentials and try again.');
       } else {
         log.message('You are now logged in as $userInfo');
       }
@@ -36,7 +37,8 @@
       final userInfo = await _retrieveUserInfo();
       if (userInfo == null) {
         log.warning('Your credentials seems broken.\n'
-            'Run `$topLevelProgram pub logout` to delete your credentials and try again.');
+            'Run `$topLevelProgram pub logout` '
+            'to delete your credentials and try again.');
       }
       log.warning('You are already logged in as $userInfo\n'
           'Run `$topLevelProgram pub logout` to log out and try again.');
diff --git a/lib/src/command/outdated.dart b/lib/src/command/outdated.dart
index 19235b2..beda8b6 100644
--- a/lib/src/command/outdated.dart
+++ b/lib/src/command/outdated.dart
@@ -67,9 +67,11 @@
 
     argParser.addOption(
       'mode',
-      help: 'Highlight versions with PROPERTY.\n'
-          'Only packages currently missing that PROPERTY will be included unless '
-          '--show-all.',
+      help: '''
+Highlight versions with PROPERTY.
+Only packages currently missing that PROPERTY will be included unless 
+--show-all.
+''',
       valueHelp: 'PROPERTY',
       allowed: ['outdated', 'null-safety'],
       defaultsTo: 'outdated',
@@ -299,7 +301,8 @@
 
       var isCurrentAffectedByAdvisory = false;
       if (currentVersionDetails != null) {
-        // Filter out advisories added to `ignored_advisores` in the root pubspec.
+        // Filter out advisories added to `ignored_advisores` in the root
+        // pubspec.
         packageAdvisories = packageAdvisories
             .where(
               (adv) => entrypoint.workspaceRoot.pubspec.ignoredAdvisories
@@ -672,9 +675,10 @@
             'To update it, use `$topLevelProgram pub upgrade`.');
       } else {
         log.message(
-            '\n$upgradable upgradable dependencies are locked (in pubspec.lock) '
-            'to older versions.\n'
-            'To update these dependencies, use `$topLevelProgram pub upgrade`.');
+          '\n$upgradable upgradable dependencies are locked '
+          '(in pubspec.lock) to older versions.\n'
+          'To update these dependencies, use `$topLevelProgram pub upgrade`.',
+        );
       }
     }
 
@@ -683,14 +687,17 @@
         rows.isNotEmpty &&
         (directRows.isNotEmpty || devRows.isNotEmpty)) {
       log.message(
-          "You are already using the newest resolvable versions listed in the 'Resolvable' column.\n"
-          "Newer versions, listed in 'Latest', may not be mutually compatible.");
+        'You are already using the newest resolvable versions listed in the '
+        "'Resolvable' column.\n"
+        "Newer versions, listed in 'Latest', may not be mutually compatible.",
+      );
     } else if (directRows.isEmpty && devRows.isEmpty) {
       log.message(mode.allSafe);
     }
   } else {
     log.message('\nNo pubspec.lock found. There are no Current versions.\n'
-        'Run `$topLevelProgram pub get` to create a pubspec.lock with versions matching your '
+        'Run `$topLevelProgram pub get` to create a pubspec.lock '
+        'with versions matching your '
         'pubspec.yaml.');
   }
   if (notAtResolvable != 0) {
@@ -815,8 +822,8 @@
       '''No resolution was found. Try running `$topLevelProgram pub upgrade --dry-run` to explore why.''';
 
   @override
-  String get upgradeConstrained =>
-      'edit pubspec.yaml, or run `$topLevelProgram pub upgrade --major-versions`';
+  String get upgradeConstrained => 'edit pubspec.yaml, or run '
+      '`$topLevelProgram pub upgrade --major-versions`';
 
   @override
   String get allSafe => 'all dependencies are up-to-date.';
@@ -1117,8 +1124,8 @@
       .any((p) => p.dependencies.containsKey(name));
 }
 
-/// Whether the package [name] is dev-depended on directly anywhere in the workspace
-/// rooted at [workspaceRoot].
+/// Whether the package [name] is dev-depended on directly anywhere in the
+/// workspace rooted at [workspaceRoot].
 bool hasDevDependency(Package workspaceRoot, String name) {
   return workspaceRoot.transitiveWorkspace
       .any((p) => p.devDependencies.containsKey(name));
diff --git a/lib/src/command/remove.dart b/lib/src/command/remove.dart
index 5c2f84c..a1425c9 100644
--- a/lib/src/command/remove.dart
+++ b/lib/src/command/remove.dart
@@ -160,8 +160,9 @@
         }
       }
       if (!found) {
+        final pubspecPath = entrypoint.workPackage.pubspecPath;
         log.warning(
-          'Package "$name" was not found in ${entrypoint.workPackage.pubspecPath}!',
+          'Package "$name" was not found in $pubspecPath!',
         );
       }
     }
diff --git a/lib/src/command/token_list.dart b/lib/src/command/token_list.dart
index 61b797f..6d53f90 100644
--- a/lib/src/command/token_list.dart
+++ b/lib/src/command/token_list.dart
@@ -18,8 +18,8 @@
   Future<void> runProtected() async {
     if (cache.tokenStore.credentials.isNotEmpty) {
       log.message(
-        'You have secret tokens for ${cache.tokenStore.credentials.length} package '
-        'repositories:',
+        'You have secret tokens for ${cache.tokenStore.credentials.length} '
+        'package repositories:',
       );
       for (final token in cache.tokenStore.credentials) {
         log.message(token.url.toString());
diff --git a/lib/src/command/unpack.dart b/lib/src/command/unpack.dart
index 6c96f67..2ee228f 100644
--- a/lib/src/command/unpack.dart
+++ b/lib/src/command/unpack.dart
@@ -124,7 +124,8 @@
         deleteEntry(destinationDir);
       } else {
         fail(
-          'Target directory `$destinationDir` already exists. Use --force to overwrite.',
+          'Target directory `$destinationDir` already exists. '
+          'Use --force to overwrite.',
         );
       }
     }
@@ -183,7 +184,8 @@
             'environment': {'sdk': sdk.version.toString()},
           },
           cache.sources,
-          // Resolve relative paths relative to current, not where the pubspec.yaml is.
+          // Resolve relative paths relative to current, not where the
+          // pubspec.yaml is.
           location: p.toUri(p.join(p.current, 'descriptor')),
           containingDescription: RootDescription('.'),
         );
diff --git a/lib/src/command/upgrade.dart b/lib/src/command/upgrade.dart
index 4de48e5..0f2abec 100644
--- a/lib/src/command/upgrade.dart
+++ b/lib/src/command/upgrade.dart
@@ -167,7 +167,8 @@
   }
 
   /// Return names of packages to be upgraded, and throws [UsageException] if
-  /// any package names not in the direct dependencies or dev_dependencies are given.
+  /// any package names not in the direct dependencies or dev_dependencies are
+  /// given.
   ///
   /// This assumes that `--major-versions` was passed.
   List<String> _directDependenciesToUpgrade() {
diff --git a/lib/src/dart.dart b/lib/src/dart.dart
index f36fc83..b72f7d2 100644
--- a/lib/src/dart.dart
+++ b/lib/src/dart.dart
@@ -152,7 +152,8 @@
     // This should make this slightly easier to recognize in error reports.
     if (!fileExists(temporaryIncrementalDill)) {
       log.error(
-        'Compilation did not produce any result. Expected file at `$temporaryIncrementalDill`',
+        'Compilation did not produce any result. '
+        'Expected file at `$temporaryIncrementalDill`',
         result.dillOutput,
       );
     }
diff --git a/lib/src/entrypoint.dart b/lib/src/entrypoint.dart
index d9f940d..dce2e52 100644
--- a/lib/src/entrypoint.dart
+++ b/lib/src/entrypoint.dart
@@ -132,8 +132,9 @@
       }
     }
     if (pubspecsMet.isEmpty) {
+      final dir = p.normalize(p.absolute(workingDir));
       throw FileException(
-        'Found no `pubspec.yaml` file in `${p.normalize(p.absolute(workingDir))}` or parent directories',
+        'Found no `pubspec.yaml` file in `$dir` or parent directories',
         p.join(workingDir, 'pubspec.yaml'),
       );
     } else {
@@ -216,8 +217,8 @@
           e.message,
           e.span,
           explanation: 'Failed parsing lock file:',
-          hint:
-              'Consider deleting the file and running `$topLevelProgram pub get` to recreate it.',
+          hint: 'Consider deleting the file and running '
+              '`$topLevelProgram pub get` to recreate it.',
         );
       }
     }
@@ -244,7 +245,8 @@
       packageConfigRaw = readTextFile(packageConfigPath);
     } on FileException {
       dataError(
-        'The "$packageConfigPath" file does not exist, please run "$topLevelProgram pub get".',
+        'The "$packageConfigPath" file does not exist, '
+        'please run "$topLevelProgram pub get".',
       );
     }
     late PackageConfig result;
@@ -275,8 +277,8 @@
 
   Future<PackageGraph> _createPackageGraph() async {
     // TODO(sigurdm): consider having [ensureUptoDate] and [acquireDependencies]
-    // return the package-graph, such it by construction will always made from an
-    // up-to-date package-config.
+    // return the package-graph, such it by construction will always made from
+    // an up-to-date package-config.
     await ensureUpToDate(workspaceRoot.dir, cache: cache);
     final packages = {
       for (var packageEntry in packageConfig.nonInjectedPackages)
@@ -483,7 +485,9 @@
       },
     );
 
-    return '${const JsonEncoder.withIndent('  ').convert(packageConfig.toJson())}\n';
+    final jsonText =
+        const JsonEncoder.withIndent('  ').convert(packageConfig.toJson());
+    return '$jsonText\n';
   }
 
   /// Gets all dependencies of the [workspaceRoot] package.
@@ -754,8 +758,8 @@
     /// Whether the lockfile is out of date with respect to the dependencies'
     /// pubspecs.
     ///
-    /// If any mutable pubspec contains dependencies that are not in the lockfile
-    /// or that don't match what's in there, this will return `false`.
+    /// If any mutable pubspec contains dependencies that are not in the
+    /// lockfile or that don't match what's in there, this will return `false`.
     bool isLockFileUpToDate(
       LockFile lockFile,
       Package root, {
@@ -784,7 +788,8 @@
         if (sdkVersion != null) {
           if (!constraint.effectiveConstraint.allows(sdkVersion)) {
             log.fine(
-              '`$lockFilePath` requires $sdkName $constraint. Current version is $sdkVersion',
+              '`$lockFilePath` requires $sdkName $constraint. '
+              'Current version is $sdkVersion',
             );
             return false;
           }
@@ -838,17 +843,17 @@
     }) {
       /// Determines if [lockFile] agrees with the given [packagePathsMapping].
       ///
-      /// The [packagePathsMapping] is a mapping from package names to paths where
-      /// the packages are located. (The library is located under
-      /// `lib/` relative to the path given).
+      /// The [packagePathsMapping] is a mapping from package names to paths
+      /// where the packages are located. (The library is located under `lib/`
+      /// relative to the path given).
       bool isPackagePathsMappingUpToDateWithLockfile(
         Map<String, String> packagePathsMapping, {
         required String lockFilePath,
         required String packageConfigPath,
       }) {
-        // Check that [packagePathsMapping] does not contain more packages than what
-        // is required. This could lead to import statements working, when they are
-        // not supposed to work.
+        // Check that [packagePathsMapping] does not contain more packages than
+        // what is required. This could lead to import statements working, when
+        // they are not supposed to work.
         final hasExtraMappings = !packagePathsMapping.keys.every((packageName) {
           return packageName == root.name ||
               lockFile.packages.containsKey(packageName);
@@ -862,8 +867,8 @@
         return lockFile.packages.values.every((lockFileId) {
           // It's very unlikely that the lockfile is invalid here, but it's not
           // impossible—for example, the user may have a very old application
-          // package with a checked-in lockfile that's newer than the pubspec, but
-          // that contains SDK dependencies.
+          // package with a checked-in lockfile that's newer than the pubspec,
+          // but that contains SDK dependencies.
           if (lockFileId.source is UnknownSource) return false;
 
           final packagePath = packagePathsMapping[lockFileId.name];
@@ -883,8 +888,8 @@
           }
 
           // For cached sources, make sure the directory exists and looks like a
-          // package. This is also done by [_arePackagesAvailable] but that may not
-          // be run if the lockfile is newer than the pubspec.
+          // package. This is also done by [_arePackagesAvailable] but that may
+          // not be run if the lockfile is newer than the pubspec.
           if (source is CachedSource && !dirExists(lockFilePackagePath) ||
               !fileExists(p.join(lockFilePackagePath, 'pubspec.yaml'))) {
             return false;
@@ -901,7 +906,8 @@
         // Pub always makes a packageUri of lib/
         if (pkg.packageUri == null || pkg.packageUri.toString() != 'lib/') {
           log.fine(
-            'The "$packageConfigPath" file is not recognized by this pub version.',
+            'The "$packageConfigPath" file '
+            'is not recognized by this pub version.',
           );
           return false;
         }
@@ -941,8 +947,8 @@
         }
 
         try {
-          // Load `pubspec.yaml` and extract language version to compare with the
-          // language version from `package_config.json`.
+          // Load `pubspec.yaml` and extract language version to compare with
+          // the language version from `package_config.json`.
           final languageVersion = cache.load(id).pubspec.languageVersion;
           if (pkg.languageVersion != languageVersion) {
             final relativePubspecPath = p.join(
@@ -1026,7 +1032,8 @@
         final workspaceRefText = tryReadTextFile(potentialWorkspaceRefPath);
         if (workspaceRefText == null) {
           log.fine(
-            '`$potentialPubspacPath` exists without corresponding `$potentialPubspacPath` or `$potentialWorkspaceRefPath`.',
+            '`$potentialPubspacPath` exists without corresponding '
+            '`$potentialPubspacPath` or `$potentialWorkspaceRefPath`.',
           );
           return null;
         } else {
@@ -1048,7 +1055,8 @@
               packageConfigStat = tryStatFile(potentialPackageConfigPath2);
               if (packageConfigStat == null) {
                 log.fine(
-                  '`$potentialWorkspaceRefPath` points to non-existing `$potentialPackageConfigPath2`',
+                  '`$potentialWorkspaceRefPath` points to non-existing '
+                  '`$potentialPackageConfigPath2`',
                 );
                 return null;
               } else {
@@ -1068,7 +1076,8 @@
               }
             } else {
               log.fine(
-                '`$potentialWorkspaceRefPath` is missing "workspaceRoot" property',
+                '`$potentialWorkspaceRefPath` '
+                'is missing "workspaceRoot" property',
               );
               return null;
             }
@@ -1126,8 +1135,11 @@
       // If the pub cache was moved we should have a new resolution.
       final rootCacheUrl = p.toUri(p.absolute(cache.rootDir)).toString();
       if (packageConfig.additionalProperties['pubCache'] != rootCacheUrl) {
+        final previousPubCachePath =
+            packageConfig.additionalProperties['pubCache'];
         log.fine(
-          'The pub cache has moved from ${packageConfig.additionalProperties['pubCache']} to $rootCacheUrl since last invocation.',
+          'The pub cache has moved from $previousPubCachePath to $rootCacheUrl '
+          'since last invocation.',
         );
         return null;
       }
@@ -1152,7 +1164,8 @@
             rootDir,
             '.dart_tool',
             package.rootUri
-                // Important to use `toFilePath()` here rather than `path`, as it handles Url-decoding.
+                // Important to use `toFilePath()` here rather than `path`, as
+                // it handles Url-decoding.
                 .toFilePath(),
             'pubspec.yaml',
           ),
@@ -1471,8 +1484,10 @@
         log.message('\nNo changes $wouldBe pubspec.yaml!');
       } else {
         final changed = dryRun ? 'Would change' : 'Changed';
+        final constraints =
+            pluralize('constraint', changesToWorkspaceRoot.length);
         log.message('\n$changed ${changesToWorkspaceRoot.length} '
-            '${pluralize('constraint', changesToWorkspaceRoot.length)} in pubspec.yaml:');
+            '$constraints in pubspec.yaml:');
         changesToWorkspaceRoot.forEach((from, to) {
           log.message('  ${from.name}: ${from.constraint} -> ${to.constraint}');
         });
@@ -1486,8 +1501,9 @@
         final changesToPackage = changeSet[package] ?? {};
         if (changesToPackage.isEmpty) continue;
         final changed = dryRun ? 'Would change' : 'Changed';
+        final constraints = pluralize('constraint', changesToPackage.length);
         log.message('\n$changed ${changesToPackage.length} '
-            '${pluralize('constraint', changesToPackage.length)} in ${package.pubspecPath}:');
+            '$constraints in ${package.pubspecPath}:');
         changesToPackage.forEach((from, to) {
           log.message('  ${from.name}: ${from.constraint} -> ${to.constraint}');
         });
diff --git a/lib/src/executable.dart b/lib/src/executable.dart
index 8a73f95..4bfd747 100644
--- a/lib/src/executable.dart
+++ b/lib/src/executable.dart
@@ -351,8 +351,10 @@
   )?.$1;
 
   if (rootPackageName == null) {
+    final packageConfigPath =
+        p.join(workspaceRootDir, '.dart_tool', 'package_config.json');
     throw CommandResolutionFailedException._(
-      '${p.join(workspaceRootDir, '.dart_tool', 'package_config.json')} did not contain its own root package',
+      '$packageConfigPath did not contain its own root package',
       CommandResolutionIssue.fileNotFound,
     );
   }
diff --git a/lib/src/flutter_releases.dart b/lib/src/flutter_releases.dart
index 472e31d..ec7abd1 100644
--- a/lib/src/flutter_releases.dart
+++ b/lib/src/flutter_releases.dart
@@ -109,6 +109,7 @@
     required this.channel,
   });
   @override
-  String toString() =>
-      'FlutterRelease(flutter=$flutterVersion, dart=$dartVersion, channel=$channel)';
+  String toString() => 'FlutterRelease(flutter=$flutterVersion, '
+      'dart=$dartVersion, '
+      'channel=$channel)';
 }
diff --git a/lib/src/global_packages.dart b/lib/src/global_packages.dart
index 1f5dcde..f617685 100644
--- a/lib/src/global_packages.dart
+++ b/lib/src/global_packages.dart
@@ -642,12 +642,12 @@
   /// If `null`, all executables in the package will get binstubs. If empty, no
   /// binstubs will be created.
   ///
-  /// If [overwriteBinStubs] is `true`, any binstubs that collide with
-  /// existing binstubs in other packages will be overwritten by this one's.
-  /// Otherwise, the previous ones will be preserved.
+  /// If [overwriteBinStubs] is `true`, any binstubs that collide with existing
+  /// binstubs in other packages will be overwritten by this one's. Otherwise,
+  /// the previous ones will be preserved.
   ///
-  /// If [suggestIfNotOnPath] is `true` (the default), this will warn the user if
-  /// the bin directory isn't on their path.
+  /// If [suggestIfNotOnPath] is `true` (the default), this will warn the user
+  /// if the bin directory isn't on their path.
   void _updateBinStubs(
     Entrypoint entrypoint,
     Package package,
diff --git a/lib/src/http.dart b/lib/src/http.dart
index c972929..2e01664 100644
--- a/lib/src/http.dart
+++ b/lib/src/http.dart
@@ -243,8 +243,10 @@
       error['message'] is! String) {
     invalidServerResponse(response);
   }
+  final formattedMessage =
+      log.red(sanitizeForTerminal(error['message'] as String));
   fail(
-    'Message from server: ${log.red(sanitizeForTerminal(error['message'] as String))}',
+    'Message from server: $formattedMessage',
   );
 }
 
@@ -268,7 +270,8 @@
       final code = getTagText('Code');
       // TODO(sigurdm): we could hard-code nice error messages for known codes.
       final message = getTagText('Message');
-      // `Details` are not specified in the doc above, but have been observed in actual responses.
+      // `Details` are not specified in the doc above, but have been observed in
+      // actual responses.
       final details = getTagText('Details');
       if (code != null) {
         log.error('Server error code: ${sanitizeForTerminal(code)}');
diff --git a/lib/src/io.dart b/lib/src/io.dart
index db1a9ab..ab980f5 100644
--- a/lib/src/io.dart
+++ b/lib/src/io.dart
@@ -382,15 +382,15 @@
         if (entity is Link) return false;
         if (includeHidden) return true;
 
-        // Using substring here is generally problematic in cases where dir has one
-        // or more trailing slashes. If you do listDir("foo"), you'll get back
-        // paths like "foo/bar". If you do listDir("foo/"), you'll get "foo/bar"
-        // (note the trailing slash was dropped. If you do listDir("foo//"), you'll
-        // get "foo//bar".
+        // Using substring here is generally problematic in cases where dir has
+        // one or more trailing slashes. If you do listDir("foo"), you'll get
+        // back paths like "foo/bar". If you do listDir("foo/"), you'll get
+        // "foo/bar" (note the trailing slash was dropped. If you do
+        // listDir("foo//"), you'll get "foo//bar".
         //
-        // This means if you strip off the prefix, the resulting string may have a
-        // leading separator (if the prefix did not have a trailing one) or it may
-        // not. However, since we are only using the results of that to call
+        // This means if you strip off the prefix, the resulting string may have
+        // a leading separator (if the prefix did not have a trailing one) or it
+        // may not. However, since we are only using the results of that to call
         // contains() on, the leading separator is harmless.
         assert(entity.path.startsWith(dir));
         var pathInDir = entity.path.substring(dir.length);
@@ -570,7 +570,8 @@
       // https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/include/uapi/asm-generic/errno-base.h#n21
       // https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/include/uapi/asm-generic/errno.h#n20
       (Platform.isLinux && (errorCode == 39 || errorCode == 17)) ||
-          // On Windows this may fail with ERROR_DIR_NOT_EMPTY or ERROR_ALREADY_EXISTS
+          // On Windows this may fail with ERROR_DIR_NOT_EMPTY or
+          // ERROR_ALREADY_EXISTS
           // https://docs.microsoft.com/en-us/windows/win32/debug/system-error-codes--0-499-
           (Platform.isWindows && (errorCode == 145 || errorCode == 183)) ||
           // On MacOS rename will fail with ENOTEMPTY if directory exists.
@@ -738,7 +739,8 @@
     return true;
   } else {
     throw DataException(
-      'Environment variable ${EnvironmentKeys.forceTerminalOutput} has unsupported value: $environmentValue.',
+      'Environment variable ${EnvironmentKeys.forceTerminalOutput} has '
+      'unsupported value: $environmentValue.',
     );
   }
 }
diff --git a/lib/src/oauth2.dart b/lib/src/oauth2.dart
index a8d36e3..2e286cc 100644
--- a/lib/src/oauth2.dart
+++ b/lib/src/oauth2.dart
@@ -440,8 +440,8 @@
   /// be specified via [scopes]. The scope strings are specific to the
   /// authorization server and may be found in its documentation. Note that you
   /// may not be granted access to every scope you request; you may check the
-  /// [Credentials.scopes] field of [_Client.credentials] to see which scopes you
-  /// were granted.
+  /// [Credentials.scopes] field of [_Client.credentials] to see which scopes
+  /// you were granted.
   ///
   /// An opaque [state] string may also be passed that will be present in the
   /// query parameters provided to the redirect URL.
@@ -682,7 +682,8 @@
 /// This means that any request may throw an [_AuthorizationException] if the
 /// refresh is not authorized for some reason, a [FormatException] if the
 /// authorization server provides ill-formatted responses, or an
-/// [_ExpirationException] if the credentials are expired and can't be refreshed.
+/// [_ExpirationException] if the credentials are expired and can't be
+/// refreshed.
 ///
 /// The client will also throw an [_AuthorizationException] if the resource
 /// server returns a 401 response with a WWW-Authenticate header indicating that
@@ -1208,7 +1209,8 @@
           expiresIn = double.parse(expiresIn).toInt();
         } on FormatException {
           throw FormatException(
-            'parameter "expires_in" could not be parsed as in, was: "$expiresIn"',
+            'parameter "expires_in" '
+            'could not be parsed as in, was: "$expiresIn"',
           );
         }
       } else if (expiresIn is! int) {
diff --git a/lib/src/package.dart b/lib/src/package.dart
index 4ccab8f..db53ec1 100644
--- a/lib/src/package.dart
+++ b/lib/src/package.dart
@@ -179,9 +179,10 @@
             withPubspecOverrides: withPubspecOverrides,
           );
         } on FileException catch (e) {
+          final pubspecPath = p.join(dir, 'pubspec.yaml');
           throw FileException(
             '${e.message}\n'
-            'That was included in the workspace of ${p.join(dir, 'pubspec.yaml')}.',
+            'That was included in the workspace of $pubspecPath.',
             e.path,
           );
         }
@@ -322,7 +323,8 @@
                 rules,
                 onInvalidPattern: (pattern, exception) {
                   log.warning(
-                    '$ignoreFile had invalid pattern $pattern. ${exception.message}',
+                    '$ignoreFile had invalid pattern $pattern. '
+                    '${exception.message}',
                   );
                 },
                 // Ignore case on macOS and Windows, because `git clone` and
diff --git a/lib/src/pubspec.dart b/lib/src/pubspec.dart
index bf54497..fcd9259 100644
--- a/lib/src/pubspec.dart
+++ b/lib/src/pubspec.dart
@@ -38,8 +38,8 @@
   // initialization can throw a [PubspecException], that error should also be
   // exposed through [allErrors].
 
-  /// The fields of [pubspecOverridesFilename]. `null` if no such file exists or has
-  /// to be considered.
+  /// The fields of [pubspecOverridesFilename]. `null` if no such file exists or
+  /// has to be considered.
   final YamlMap? _overridesFileFields;
 
   String? get _packageName => fields['name'] != null ? name : null;
@@ -69,7 +69,8 @@
     final r = fields.nodes['workspace'];
     if (r != null && !languageVersion.supportsWorkspaces) {
       _error(
-        '`workspace` and `resolution` requires at least language version ${LanguageVersion.firstVersionWithWorkspaces}',
+        '`workspace` and `resolution` requires at least language version '
+        '${LanguageVersion.firstVersionWithWorkspaces}',
         r.span,
       );
     }
@@ -99,7 +100,8 @@
     final r = fields.nodes['resolution'];
     if (r != null && !languageVersion.supportsWorkspaces) {
       _error(
-        '`workspace` and `resolution` requires at least language version ${LanguageVersion.firstVersionWithWorkspaces}',
+        '`workspace` and `resolution` requires at least language version '
+        '${LanguageVersion.firstVersionWithWorkspaces}',
         r.span,
       );
     }
@@ -141,13 +143,14 @@
 
   Map<String, PackageRange>? _devDependencies;
 
-  /// The dependency constraints that this package overrides when it is the
-  /// root package.
+  /// The dependency constraints that this package overrides when it is the root
+  /// package.
   ///
   /// Dependencies here will replace any dependency on a package with the same
   /// name anywhere in the dependency graph.
   ///
-  /// These can occur both in the pubspec.yaml file and the [pubspecOverridesFilename].
+  /// These can occur both in the pubspec.yaml file and the
+  /// [pubspecOverridesFilename].
   Map<String, PackageRange> get dependencyOverrides {
     if (_dependencyOverrides != null) return _dependencyOverrides!;
     final pubspecOverridesFields = _overridesFileFields;
@@ -156,7 +159,8 @@
         final keyNode = key as YamlNode;
         if (!const {'dependency_overrides'}.contains(keyNode.value)) {
           throw SourceSpanApplicationException(
-            'pubspec_overrides.yaml only supports the `dependency_overrides` field.',
+            'pubspec_overrides.yaml only supports the '
+            '`dependency_overrides` field.',
             keyNode.span,
           );
         }
@@ -344,8 +348,8 @@
         sources = sources ??
             ((String? name) => throw StateError('No source registry given')),
         _overridesFileFields = null,
-        // This is a dummy value.
-        // Dependencies should already be resolved, so we never need to do relative resolutions.
+        // This is a dummy value. Dependencies should already be resolved, so we
+        // never need to do relative resolutions.
         _containingDescription = RootDescription('.'),
         super(
           fields == null ? YamlMap() : YamlMap.wrap(fields),
@@ -487,7 +491,8 @@
     return errors;
   }
 
-  /// Returns a list of errors relevant to consuming this pubspec as a dependency
+  /// Returns a list of errors relevant to consuming this pubspec as a
+  /// dependency
   ///
   /// This will return at most one error for each field.
   List<SourceSpanApplicationException> get dependencyErrors =>
diff --git a/lib/src/pubspec_parse.dart b/lib/src/pubspec_parse.dart
index 26b3eec..3f9824e 100644
--- a/lib/src/pubspec_parse.dart
+++ b/lib/src/pubspec_parse.dart
@@ -18,10 +18,12 @@
     RegExp('^${identifierRegExp.pattern}(\\.${identifierRegExp.pattern})*\$');
 
 /// Helper class for pubspec parsing to:
-/// - extract the fields and methods that are reusable outside of `pub` client, and
+/// - extract the fields and methods that are reusable outside of `pub` client,
+///   and
 /// - help null-safety migration a bit.
 ///
-/// This class should be eventually extracted to a separate library, or re-merged with `Pubspec`.
+/// This class should be eventually extracted to a separate library, or
+/// re-merged with `Pubspec`.
 abstract class PubspecBase {
   /// All pubspec fields.
   ///
diff --git a/lib/src/solver/failure.dart b/lib/src/solver/failure.dart
index ab136f9..7f784d0 100644
--- a/lib/src/solver/failure.dart
+++ b/lib/src/solver/failure.dart
@@ -215,9 +215,15 @@
       final conflictLine = _lineNumbers[conflictClause.conflict];
       final otherLine = _lineNumbers[conflictClause.other];
       if (conflictLine != null && otherLine != null) {
+        final conflictAndOther = conflictClause.conflict.andToString(
+          conflictClause.other,
+          detailsForCause,
+          conflictLine,
+          otherLine,
+        );
         _write(
           incompatibility,
-          'Because ${conflictClause.conflict.andToString(conflictClause.other, detailsForCause, conflictLine, otherLine)}, $incompatibilityString.',
+          'Because $conflictAndOther, $incompatibilityString.',
           numbered: numbered,
         );
       } else if (conflictLine != null || otherLine != null) {
@@ -281,9 +287,11 @@
 
       final derivedLine = _lineNumbers[derived];
       if (derivedLine != null) {
+        final extAndDerived =
+            ext.andToString(derived, detailsForCause, null, derivedLine);
         _write(
           incompatibility,
-          'Because ${ext.andToString(derived, detailsForCause, null, derivedLine)}, $incompatibilityString.',
+          'Because $extAndDerived, $incompatibilityString.',
           numbered: numbered,
         );
       } else if (_isCollapsible(derived)) {
@@ -319,10 +327,12 @@
         );
       }
     } else {
+      final conflictAndOther = conflictClause.conflict
+          .andToString(conflictClause.other, detailsForCause);
       _write(
         incompatibility,
         'Because '
-        '${conflictClause.conflict.andToString(conflictClause.other, detailsForCause)}, '
+        '$conflictAndOther, '
         '$incompatibilityString.',
         numbered: numbered,
       );
diff --git a/lib/src/solver/incompatibility.dart b/lib/src/solver/incompatibility.dart
index bf63357..1b4f714 100644
--- a/lib/src/solver/incompatibility.dart
+++ b/lib/src/solver/incompatibility.dart
@@ -419,7 +419,8 @@
     buffer.write('${_terse(latter.terms.first, details)} ');
     if (priorLine != null) buffer.write('($priorLine) ');
 
-    if (latter.cause is SdkIncompatibilityCause) {
+    final latterCause = latter.cause;
+    if (latterCause is SdkIncompatibilityCause) {
       final cause = latter.cause as SdkIncompatibilityCause;
       if (cause.noNullSafetyCause) {
         buffer.write('which doesn\'t support null safety');
@@ -432,11 +433,12 @@
           buffer.write('SDK version ${cause.constraint}');
         }
       }
-    } else if (latter.cause is NoVersionsIncompatibilityCause) {
+    } else if (latterCause is NoVersionsIncompatibilityCause) {
       buffer.write("which doesn't match any versions");
-    } else if (latter.cause is PackageNotFoundIncompatibilityCause) {
+    } else if (latterCause is PackageNotFoundIncompatibilityCause) {
+      final exceptionMessage = latterCause.exception.message;
       buffer.write("which doesn't exist "
-          '(${(latter.cause as PackageNotFoundIncompatibilityCause).exception.message})');
+          '($exceptionMessage)');
     } else {
       buffer.write('which is forbidden');
     }
diff --git a/lib/src/solver/partial_solution.dart b/lib/src/solver/partial_solution.dart
index 90b869c..8b0fe25 100644
--- a/lib/src/solver/partial_solution.dart
+++ b/lib/src/solver/partial_solution.dart
@@ -98,7 +98,8 @@
       if (removed.isDecision) _decisions.remove(removed.package.name);
     }
 
-    // Re-compute [_positive] and [_negative] for the packages that were removed.
+    // Re-compute [_positive] and [_negative] for the packages that were
+    // removed.
     for (var package in packages) {
       _positive.remove(package);
       _negative.remove(package);
diff --git a/lib/src/solver/report.dart b/lib/src/solver/report.dart
index 880fdf2..302f133 100644
--- a/lib/src/solver/report.dart
+++ b/lib/src/solver/report.dart
@@ -285,7 +285,8 @@
         packageCountString = '$outdatedPackagesCount packages have';
       }
       message('$packageCountString newer versions incompatible with '
-          'dependency constraints.\nTry `$topLevelProgram pub outdated` for more information.');
+          'dependency constraints.\n'
+          'Try `$topLevelProgram pub outdated` for more information.');
     }
   }
 
diff --git a/lib/src/solver/solve_suggestions.dart b/lib/src/solver/solve_suggestions.dart
index 7c0efa7..ab92339 100644
--- a/lib/src/solver/solve_suggestions.dart
+++ b/lib/src/solver/solve_suggestions.dart
@@ -82,11 +82,13 @@
   if (suggestions.isEmpty) return null;
   final tryOne = suggestions.length == 1
       ? 'You can try the following suggestion to make the pubspec resolve:'
-      : 'You can try one of the following suggestions to make the pubspec resolve:';
+      : 'You can try one of the following suggestions '
+          'to make the pubspec resolve:';
 
   suggestions.sort((a, b) => a.priority.compareTo(b.priority));
 
-  return '\n$tryOne\n${suggestions.take(5).map((e) => e.suggestion).join('\n')}';
+  return '\n$tryOne\n'
+      '${suggestions.take(5).map((e) => e.suggestion).join('\n')}';
 }
 
 class _ResolutionSuggestion {
@@ -164,7 +166,8 @@
     }
     return _ResolutionSuggestion(
       runningFromFlutter
-          ? '* Try using the Flutter SDK version: ${bestRelease.flutterVersion}. '
+          ? '* Try using the Flutter SDK version: '
+              '${bestRelease.flutterVersion}. '
           :
           // Here we assume that any Dart version included in a Flutter
           // release can also be found as a released Dart SDK.
@@ -206,19 +209,19 @@
     final addDescription = packageAddDescription(entrypoint, resolvingPackage);
 
     var priority = 1;
-    var suggestion =
-        '* Try updating your constraint on $name: $topLevelProgram pub add $addDescription';
+    var suggestion = '* Try updating your constraint on $name: '
+        '$topLevelProgram pub add $addDescription';
     if (originalConstraint is VersionRange) {
       final min = originalConstraint.min;
       if (min != null) {
         if (resolvingPackage.version < min) {
           priority = 3;
-          suggestion =
-              '* Consider downgrading your constraint on $name: $topLevelProgram pub add $addDescription';
+          suggestion = '* Consider downgrading your constraint on $name: '
+              '$topLevelProgram pub add $addDescription';
         } else {
           priority = 2;
-          suggestion =
-              '* Try upgrading your constraint on $name: $topLevelProgram pub add $addDescription';
+          suggestion = '* Try upgrading your constraint on $name: '
+              '$topLevelProgram pub add $addDescription';
         }
       }
     }
@@ -264,12 +267,14 @@
           .map((e) => packageAddDescription(entrypoint, e))
           .join(' ');
       return _ResolutionSuggestion(
-        '* Try updating the following constraints: $topLevelProgram pub add $formattedConstraints',
+        '* Try updating the following constraints: '
+        '$topLevelProgram pub add $formattedConstraints',
         priority: 4,
       );
     } else {
       return _ResolutionSuggestion(
-        '* Try an upgrade of your constraints: $topLevelProgram pub upgrade --major-versions',
+        '* Try an upgrade of your constraints: '
+        '$topLevelProgram pub upgrade --major-versions',
         priority: 4,
       );
     }
diff --git a/lib/src/source/git.dart b/lib/src/source/git.dart
index 747d494..bbe4d21 100644
--- a/lib/src/source/git.dart
+++ b/lib/src/source/git.dart
@@ -498,7 +498,8 @@
           RepairResult(package.name, package.version, this, success: false),
         );
 
-        // Delete the revision cache path, not the subdirectory that contains the package.
+        // Delete the revision cache path, not the subdirectory that contains
+        // the package.
         final repoRoot = git.repoRoot(package.dir);
         if (repoRoot != null) tryDeleteEntry(repoRoot);
       }
@@ -691,8 +692,8 @@
     await git.run(args);
   }
 
-  /// Like [_clone], but clones to a temporary directory (inside the [cache]) and
-  /// moves
+  /// Like [_clone], but clones to a temporary directory (inside the [cache])
+  /// and moves
   Future<void> _cloneViaTemp(
     String from,
     String to,
@@ -723,7 +724,8 @@
 
   String _revisionCachePath(PackageId id, SystemCache cache) => p.join(
         cache.rootDirForSource(this),
-        '${_repoName(id.description.description as GitDescription)}-${(id.description as ResolvedGitDescription).resolvedRef}',
+        '${_repoName(id.description.description as GitDescription)}-'
+        '${(id.description as ResolvedGitDescription).resolvedRef}',
       );
 
   /// Returns the path to the canonical clone of the repository referred to by
@@ -758,8 +760,8 @@
   /// to the pubspec location, and stored here as an absolute file url, and
   /// [relative] will be true.
   ///
-  /// This will not always parse as a [Uri] due the fact that `Uri.parse` does not allow strings of
-  /// the form: 'git@github.com:dart-lang/pub.git'.
+  /// This will not always parse as a [Uri] due the fact that `Uri.parse` does
+  /// not allow strings of the form: 'git@github.com:dart-lang/pub.git'.
   final String url;
 
   /// `true` if [url] was parsed from a relative url.
diff --git a/lib/src/source/hosted.dart b/lib/src/source/hosted.dart
index ef39e40..c7d5a03 100644
--- a/lib/src/source/hosted.dart
+++ b/lib/src/source/hosted.dart
@@ -97,11 +97,12 @@
   // Changing this to pub.dev raises the following concerns:
   //
   //  1. It would blow through users caches.
-  //  2. It would cause conflicts for users checking pubspec.lock into git, if using
-  //     different versions of the dart-sdk / pub client.
-  //  3. It might cause other problems (investigation needed) for pubspec.lock across
-  //     different versions of the dart-sdk / pub client.
-  //  4. It would expand the API surface we're committed to supporting long-term.
+  //  2. It would cause conflicts for users checking pubspec.lock into git, if
+  //     using different versions of the dart-sdk / pub client.
+  //  3. It might cause other problems (investigation needed) for pubspec.lock
+  //     across different versions of the dart-sdk / pub client.
+  //  4. It would expand the API surface we're committed to supporting
+  //     long-term.
   //
   // Clearly, a bit of investigation is necessary before we update this to
   // pub.dev, it might be attractive to do next time we change the server API.
@@ -161,11 +162,12 @@
     // Changing this to pub.dev raises the following concerns:
     //
     //  1. It would blow through users caches.
-    //  2. It would cause conflicts for users checking pubspec.lock into git, if using
-    //     different versions of the dart-sdk / pub client.
-    //  3. It might cause other problems (investigation needed) for pubspec.lock across
-    //     different versions of the dart-sdk / pub client.
-    //  4. It would expand the API surface we're committed to supporting long-term.
+    //  2. It would cause conflicts for users checking pubspec.lock into git, if
+    //     using different versions of the dart-sdk / pub client.
+    //  3. It might cause other problems (investigation needed) for pubspec.lock
+    //     across different versions of the dart-sdk / pub client.
+    //  4. It would expand the API surface we're committed to supporting
+    //     long-term.
     //
     // Clearly, a bit of investigation is necessary before we update this to
     // pub.dev, it might be attractive to do next time we change the server API.
@@ -345,9 +347,11 @@
           // environment.
           return HostedDescription(description, defaultUrl);
         } else {
+          const shorterSyntaxVersion =
+              LanguageVersion.firstVersionWithShorterHostedSyntax;
           throw FormatException(
             'Using `hosted: <url>` is only supported with a minimum SDK '
-            'constraint of ${LanguageVersion.firstVersionWithShorterHostedSyntax}.',
+            'constraint of $shorterSyntaxVersion.',
           );
         }
       }
@@ -363,8 +367,12 @@
     if (canUseShorthandSyntax) name ??= packageName;
 
     if (name is! String) {
-      throw FormatException("The 'name' key must have a string value without "
-          'a minimum Dart SDK constraint of ${LanguageVersion.firstVersionWithShorterHostedSyntax}.0 or higher.');
+      const shorterSyntaxVersion =
+          LanguageVersion.firstVersionWithShorterHostedSyntax;
+      throw FormatException(
+        "The 'name' key must have a string value without "
+        'a minimum Dart SDK constraint of $shorterSyntaxVersion.0 or higher.',
+      );
     }
 
     final u = description['url'];
@@ -613,7 +621,8 @@
         );
       } else {
         log.warning(
-          'Warning: Unable to fetch advisories for "$packageName" from "$hostedUrl".\n',
+          'Warning: Unable to fetch advisories for "$packageName" '
+          'from "$hostedUrl".\n',
         );
       }
       return null;
@@ -1186,7 +1195,8 @@
     if (!fileExists(hashPath(id, cache))) {
       if (dirExists(packageDir) && !cache.isOffline) {
         log.fine(
-          'Cache entry for ${id.name}-${id.version} has no content-hash - redownloading.',
+          'Cache entry for ${id.name}-${id.version} has no content-hash '
+          '- redownloading.',
         );
         deleteEntry(packageDir);
       }
@@ -1199,7 +1209,8 @@
       final hashFromCache = sha256FromCache(id, cache);
       if (!fixedTimeBytesEquals(hashFromCache, expectedContentHash)) {
         log.warning(
-          'Cached version of ${id.name}-${id.version} has wrong hash - redownloading.',
+          'Cached version of ${id.name}-${id.version} has wrong hash '
+          '- redownloading.',
         );
         if (cache.isOffline) {
           fail('Cannot redownload while offline. Try again without --offline.');
@@ -1215,7 +1226,8 @@
       didUpdate = true;
       if (cache.isOffline) {
         fail(
-          'Missing package ${id.name}-${id.version}. Try again without --offline.',
+          'Missing package ${id.name}-${id.version}. '
+          'Try again without --offline.',
         );
       }
       contentHash = await _download(id, packageDir, cache);
@@ -1502,7 +1514,8 @@
         final actualHash = output.value;
         if (expectedHash != null && output.value != expectedHash) {
           log.fine(
-            'Expected content-hash for ${id.name}-${id.version} $expectedHash actual: ${output.value}.',
+            'Expected content-hash for ${id.name}-${id.version} $expectedHash '
+            'actual: ${output.value}.',
           );
           throw PackageIntegrityException('''
 Downloaded archive for ${id.name}-${id.version} had wrong content-hash.
@@ -1550,9 +1563,9 @@
 
             // We download the archive to disk instead of streaming it directly
             // into the tar unpacking. This simplifies stream handling.
-            // Package:tar cancels the stream when it reaches end-of-archive, and
-            // cancelling a http stream makes it not reusable.
-            // There are ways around this, and we might revisit this later.
+            // Package:tar cancels the stream when it reaches end-of-archive,
+            // and cancelling a http stream makes it not reusable. There are
+            // ways around this, and we might revisit this later.
             await createFileFromStream(stream, archivePath);
           });
         });
@@ -1624,7 +1637,8 @@
       }
       if (!fileExists(p.join(tempDir, 'pubspec.yaml'))) {
         fail(
-          'Found no `pubspec.yaml` in $archivePath. Is it a valid pub package archive?',
+          'Found no `pubspec.yaml` in $archivePath. '
+          'Is it a valid pub package archive?',
         );
       }
       final Pubspec pubspec;
@@ -1633,8 +1647,8 @@
           tempDir,
           cache.sources,
           containingDescription:
-              // Dummy description.
-              // As we never use the dependencies, they don't need to be resolved.
+              // Dummy description. As we never use the dependencies, they don't
+              // need to be resolved.
               RootDescription('.'),
         );
         final errors = pubspec.dependencyErrors;
@@ -1669,8 +1683,9 @@
     return id;
   }
 
-  /// When an error occurs trying to read something about [package] from [hostedUrl],
-  /// this tries to translate into a more user friendly error message.
+  /// When an error occurs trying to read something about [package] from
+  /// [hostedUrl], this tries to translate into a more user friendly error
+  /// message.
   ///
   /// Always throws an error, either the original one or a better one.
   static Never _throwFriendlyError(
@@ -1730,7 +1745,8 @@
       throw PackageNotFoundException(message, hint: hint);
     } else if (error is FormatException) {
       throw PackageNotFoundException(
-        'Got badly formatted response trying to find package $package at $hostedUrl',
+        'Got badly formatted response trying to find '
+        'package $package at $hostedUrl',
         innerError: error,
         innerTrace: stackTrace,
         hint: 'Check that "$hostedUrl" is a valid package repository.',
diff --git a/lib/src/source/path.dart b/lib/src/source/path.dart
index e7b7bbf..921e95e 100644
--- a/lib/src/source/path.dart
+++ b/lib/src/source/path.dart
@@ -26,15 +26,6 @@
   @override
   final name = 'path';
 
-  // /// Returns a reference to a path package named [name] at [path].
-  // PackageRef<PathDescription> refFor(String name, String path) {
-  //   if (p.isRelative(path)) {
-  //     PackageRef(name, {'path':p.absolute(path), 'relative': p.isRelative(path)});
-  //   }
-  //   return PackageRef(name, {'path': path, 'relative': p.isRelative(path)});
-  // }
-//{name: myapp, dev_dependencies: {foo: 1.2.2}, dependency_overrides: {foo: {path: ../foo}}, environment: {sdk: >=0.1.2 <1.0.0}}
-//{name: myapp, dev_dependencies: {foo: ^1.2.2}, dependency_overrides: {foo: {path: ../foo}}, environment: {sdk: >=0.1.2 <1.0.0}}
   /// Returns an ID for a path package with the given [name] and [version] at
   /// [path].
   ///
@@ -100,7 +91,8 @@
     } else if (containingDescription is GitDescription) {
       if (!isRelative) {
         throw FormatException(
-          '"$description" is an absolute path, it can\'t be referenced from a git pubspec.',
+          '"$description" is an absolute path, '
+          'it can\'t be referenced from a git pubspec.',
         );
       }
       final resolvedPath = p.url.normalize(
@@ -111,7 +103,8 @@
       );
       if (!(p.isWithin('.', resolvedPath) || p.equals('.', resolvedPath))) {
         throw FormatException(
-          'the path "$description" cannot refer outside the git repository $resolvedPath.',
+          'the path "$description" '
+          'cannot refer outside the git repository $resolvedPath.',
         );
       }
       return PackageRef(
diff --git a/lib/src/source/unknown.dart b/lib/src/source/unknown.dart
index 0402662..3ba7221 100644
--- a/lib/src/source/unknown.dart
+++ b/lib/src/source/unknown.dart
@@ -100,7 +100,8 @@
     required LanguageVersion languageVersion,
   }) {
     throw UnsupportedError(
-      "Cannot serialize a package description from an unknown source '${source.name}'.",
+      'Cannot serialize a package description '
+      "from an unknown source '${source.name}'.",
     );
   }
 
@@ -120,7 +121,8 @@
   @override
   Object? serializeForLockfile({required String? containingDir}) {
     throw UnsupportedError(
-      "Cannot serialize a package description from an unknown source '${description.source.name}'.",
+      'Cannot serialize a package description '
+      "from an unknown source '${description.source.name}'.",
     );
   }
 
diff --git a/lib/src/system_cache.dart b/lib/src/system_cache.dart
index 7bedffc..412975f 100644
--- a/lib/src/system_cache.dart
+++ b/lib/src/system_cache.dart
@@ -307,17 +307,15 @@
   ///
   /// If DEPRECATED.md is less than 7 days old, we don't repeat the warning.
   void _checkOldCacheLocation() {
-    // Background:
-    // Prior to Dart 2.8 the default location for the PUB_CACHE on Windows was:
-    //   %APPDATA%\Pub\Cache
+    // Background: Prior to Dart 2.8 the default location for the PUB_CACHE on
+    // Windows was: %APPDATA%\Pub\Cache
     //
     // Start Dart 2.8 pub started migrating the default PUB_CACHE location to:
-    //   %LOCALAPPDATA%\Pub\Cache
-    // That is:
-    //  * If a pub-cache existed in `%LOCALAPPDATA%\Pub\Cache` then it
-    //    would be used.
-    //  * If a pub-cache existed in `%APPDATA%\Pub\Cache` then it would be
-    //    used, unless a pub-cache in `%LOCALAPPDATA%\Pub\Cache` had been found.
+    //   %LOCALAPPDATA%\Pub\Cache That is:
+    //  * If a pub-cache existed in `%LOCALAPPDATA%\Pub\Cache` then it would be
+    //    used.
+    //  * If a pub-cache existed in `%APPDATA%\Pub\Cache` then it would be used,
+    //    unless a pub-cache in `%LOCALAPPDATA%\Pub\Cache` had been found.
     //  * If no pub-cache was found, a new empty pub-cache was created in
     //    `%LOCALAPPDATA%\Pub\Cache`.
     //
@@ -325,13 +323,14 @@
     // `%APPDATA%\Pub\Cache`. Instead it will always use the new location,
     // `%LOCALAPPDATA%\Pub\Cache`, as default PUB_CACHE location.
     //
-    // Using `%APPDATA%` caused the pub-cache to be copied with the user-profile,
-    // when using a networked Windows setup where users can login on multiple
-    // machines. This is undesirable because you are moving a lot of bytes over
-    // the network and onto whatever servers are storing the user profiles.
+    // Using `%APPDATA%` caused the pub-cache to be copied with the
+    // user-profile, when using a networked Windows setup where users can login
+    // on multiple machines. This is undesirable because you are moving a lot of
+    // bytes over the network and onto whatever servers are storing the user
+    // profiles.
     //
-    // Thus, we migrated to storing the pub-cache in `%LOCALAPPDATA%`.
-    // And finished the migration in Dart 3 to keep things simple.
+    // Thus, we migrated to storing the pub-cache in `%LOCALAPPDATA%`. And
+    // finished the migration in Dart 3 to keep things simple.
     if (!Platform.isWindows) return;
 
     final appData = Platform.environment['APPDATA'];
diff --git a/lib/src/utils.dart b/lib/src/utils.dart
index efb1c70..3925e36 100644
--- a/lib/src/utils.dart
+++ b/lib/src/utils.dart
@@ -593,11 +593,16 @@
       .join()
       .toUpperCase();
 
-  return '${chars.substring(0, 8)}-${chars.substring(8, 12)}-'
-      '${chars.substring(12, 16)}-${chars.substring(16, 20)}-${chars.substring(20, 32)}';
+  return ''
+      '${chars.substring(0, 8)}-'
+      '${chars.substring(8, 12)}-'
+      '${chars.substring(12, 16)}-'
+      '${chars.substring(16, 20)}-'
+      '${chars.substring(20, 32)}';
 }
 
-/// Wraps [text] so that it fits within [_lineLength], if there is a line length.
+/// Wraps [text] so that it fits within [_lineLength], if there is a line
+/// length.
 ///
 /// This preserves existing newlines and doesn't consider terminal color escapes
 /// part of a word's length. It only splits words on spaces, not on other sorts
diff --git a/lib/src/validator.dart b/lib/src/validator.dart
index c4fcdbc..112b90b 100644
--- a/lib/src/validator.dart
+++ b/lib/src/validator.dart
@@ -111,7 +111,8 @@
         '  sdk: "${newSdkConstraint.asCompatibleWithIfPossible()}"');
   }
 
-  /// Returns whether [version1] and [version2] are pre-releases of the same version.
+  /// Returns whether [version1] and [version2] are pre-releases of the same
+  /// version.
   bool _isSamePreRelease(Version version1, Version version2) =>
       version1.isPreRelease &&
       version2.isPreRelease &&
diff --git a/lib/src/validator/dependency.dart b/lib/src/validator/dependency.dart
index 7423324..3133e16 100644
--- a/lib/src/validator/dependency.dart
+++ b/lib/src/validator/dependency.dart
@@ -95,14 +95,14 @@
             '  ${dep.name}: ^${locked.version}\n';
       }
       warnings.add('$message\n'
-          'Without a constraint, you\'re promising to support ${log.bold("all")} '
-          'future versions of "${dep.name}".');
+          'Without a constraint, you\'re promising to support '
+          '${log.bold("all")} future versions of "${dep.name}".');
     }
 
     /// Warn that dependencies should allow more than a single version.
     void warnAboutSingleVersionConstraint(PackageRange dep) {
-      warnings.add(
-          'Your dependency on "${dep.name}" should allow more than one version. '
+      warnings.add('Your dependency on "${dep.name}" '
+          'should allow more than one version. '
           'For example:\n'
           '\n'
           'dependencies:\n'
@@ -132,8 +132,8 @@
             '  ${dep.name}: $constraint\n';
       }
       warnings.add('$message\n'
-          'Without a constraint, you\'re promising to support ${log.bold("all")} '
-          'previous versions of "${dep.name}".');
+          'Without a constraint, you\'re promising to support '
+          '${log.bold("all")} previous versions of "${dep.name}".');
     }
 
     /// Warn that dependencies should have upper bounds on their constraints.
diff --git a/lib/src/validator/flutter_constraint.dart b/lib/src/validator/flutter_constraint.dart
index cacb7c0..7b0527b 100644
--- a/lib/src/validator/flutter_constraint.dart
+++ b/lib/src/validator/flutter_constraint.dart
@@ -23,7 +23,8 @@
         if (constraint is VersionRange && constraint.max != null) {
           final replacement = constraint.min == null
               ? 'You can replace the constraint with `any`.'
-              : 'You can replace that with just the lower bound: `>=${constraint.min}`.';
+              : 'You can replace that with '
+                  'just the lower bound: `>=${constraint.min}`.';
 
           warnings.add('''
 The Flutter constraint should not have an upper bound.
diff --git a/lib/src/validator/leak_detection.dart b/lib/src/validator/leak_detection.dart
index 945ffb7..0f25cf6 100644
--- a/lib/src/validator/leak_detection.dart
+++ b/lib/src/validator/leak_detection.dart
@@ -2,6 +2,8 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
+// ignore_for_file: lines_longer_than_80_chars
+
 import 'dart:async';
 import 'dart:convert';
 import 'dart:io';
@@ -121,7 +123,9 @@
   String describe() {
     if (content.length > 10000) {
       // Large files are probably binary files. Don't show line numbers.
-      return 'Potential leak of ${pattern.kind} in `$url` at offset $start:$end.\n\n'
+      return 'Potential leak of ${pattern.kind} '
+          'in `$url` '
+          'at offset $start:$end.\n\n'
           '```\n${content.substring(start, end)}\n```\n';
     }
     return SourceFile.fromString(content, url: url)
@@ -242,8 +246,12 @@
     //
     // Maximum length of an access key is specified as 128 here:
     // https://docs.aws.amazon.com/IAM/latest/APIReference/API_AccessKey.html#API_AccessKey_Contents
-    pattern:
-        r'[^A-Z0-9]((?:A3T[A-Z0-9]|AKIA|AGPA|AIDA|AROA|AIPA|ANPA|ANVA|ASIA)[A-Z0-9]{12,128})[^A-Z0-9]',
+    pattern: r'[^A-Z0-9]'
+        r'('
+        r'(?:A3T[A-Z0-9]|AKIA|AGPA|AIDA|AROA|AIPA|ANPA|ANVA|ASIA)'
+        r'[A-Z0-9]{12,128}'
+        r')'
+        r'[^A-Z0-9]',
     allowed: [
       // Commonly used in AWS documentation and code samples as an example key.
       'AKIAIOSFODNN7EXAMPLE',
diff --git a/lib/src/validator/relative_version_numbering.dart b/lib/src/validator/relative_version_numbering.dart
index 91a6d91..dac2422 100644
--- a/lib/src/validator/relative_version_numbering.dart
+++ b/lib/src/validator/relative_version_numbering.dart
@@ -94,16 +94,16 @@
     final previousOptedIn = previousPubspec.languageVersion.supportsNullSafety;
 
     if (currentOptedIn && !previousOptedIn) {
-      hints.add(
-          'You\'re about to publish a package that opts into null safety.\n'
-          'The previous version ($previousVersion) isn\'t opted in.\n'
-          'See $nullSafetyGuideUrl for best practices.');
+      hints.add('''
+You're about to publish a package that opts into null safety.
+The previous version ($previousVersion) isn't opted in.
+See $nullSafetyGuideUrl for best practices.''');
     } else if (!currentOptedIn && previousOptedIn) {
-      hints.add(
-          'You\'re about to publish a package that doesn\'t opt into null safety,\n'
-          'but the previous version ($previousVersion) was opted in.\n'
-          'This change is likely to be backwards incompatible.\n'
-          'See $semverUrl for information about versioning.');
+      hints.add('''
+You're about to publish a package that doesn't opt into null safety,
+but the previous version ($previousVersion) was opted in.
+This change is likely to be backwards incompatible.
+See $semverUrl for information about versioning.''');
     }
   }
 }
diff --git a/lib/src/validator/strict_dependencies.dart b/lib/src/validator/strict_dependencies.dart
index 0bf3385..c0a203a 100644
--- a/lib/src/validator/strict_dependencies.dart
+++ b/lib/src/validator/strict_dependencies.dart
@@ -148,13 +148,14 @@
   String _toMessage(String message) =>
       errorMessage(message, _file, _contents, _directive);
 
-  /// Returns an error message saying the package is not listed in `dependencies`.
+  /// Returns an error message saying the package is not listed in
+  /// `dependencies`.
   String dependencyMissingMessage() =>
       _toMessage('This package does not have $package in the `dependencies` '
           'section of `pubspec.yaml`.');
 
-  /// Returns an error message saying the package is not listed in `dependencies`
-  ///  or `dev_dependencies`.
+  /// Returns an error message saying the package is not listed in
+  ///  `dependencies` or `dev_dependencies`.
   String dependenciesMissingMessage() =>
       _toMessage('This package does not have $package in the `dependencies` '
           'or `dev_dependencies` section of `pubspec.yaml`.');
diff --git a/test/add/common/add_test.dart b/test/add/common/add_test.dart
index 4bca499..6cd2ccb 100644
--- a/test/add/common/add_test.dart
+++ b/test/add/common/add_test.dart
@@ -89,8 +89,8 @@
     });
 
     test(
-        'does not remove empty dev_dependencies while adding to normal dependencies',
-        () async {
+        'does not remove empty dev_dependencies '
+        'while adding to normal dependencies', () async {
       await servePackages()
         ..serve('foo', '1.2.3')
         ..serve('foo', '1.2.2');
@@ -145,8 +145,8 @@
     });
 
     test(
-        'adds a package from a pub server even when dependencies key does not exist',
-        () async {
+        'adds a package from a pub server '
+        'even when dependencies key does not exist', () async {
       final server = await servePackages();
       server.serve('foo', '1.2.3');
 
@@ -217,7 +217,8 @@
         await pubAdd(
           args: ['foo'],
           output: contains(
-            '"foo" is already in "dependencies". Will try to update the constraint.',
+            '"foo" is already in "dependencies". '
+            'Will try to update the constraint.',
           ),
         );
 
@@ -234,7 +235,8 @@
         await pubAdd(
           args: ['foo:1.2.3'],
           output: contains(
-            '"foo" is already in "dependencies". Will try to update the constraint.',
+            '"foo" is already in "dependencies". '
+            'Will try to update the constraint.',
           ),
         );
 
@@ -251,7 +253,8 @@
         await pubAdd(
           args: ['foo:>=1.2.2'],
           output: contains(
-            '"foo" is already in "dependencies". Will try to update the constraint.',
+            '"foo" is already in "dependencies". '
+            'Will try to update the constraint.',
           ),
         );
 
@@ -282,7 +285,8 @@
           contains('"foo" was found in dev_dependencies. Removing "foo" and '
               'adding it to dependencies instead.'),
           contains(
-            '> foo 1.2.3 (was 1.2.2) (from dev dependency to direct dependency)',
+            '> foo 1.2.3 (was 1.2.2) '
+            '(from dev dependency to direct dependency)',
           ),
         ),
       );
@@ -576,7 +580,8 @@
     await pubAdd(
       args: ['foo:{"path":"../foo"}', '--path=../foo'],
       error: contains(
-        '--dev, --path, --sdk, --git-url, --git-path and --git-ref cannot be combined',
+        '--dev, --path, --sdk, --git-url, --git-path and --git-ref '
+        'cannot be combined',
       ),
       exitCode: exit_codes.USAGE,
     );
@@ -615,7 +620,8 @@
       await pubAdd(
         args: ['--dev', 'foo:{"path":../foo}'],
         error: contains(
-          '--dev, --path, --sdk, --git-url, --git-path and --git-ref cannot be combined',
+          '--dev, --path, --sdk, --git-url, --git-path and --git-ref '
+          'cannot be combined',
         ),
         exitCode: exit_codes.USAGE,
       );
@@ -699,7 +705,8 @@
         await pubAdd(
           args: ['foo', '--dev'],
           output: contains(
-            '"foo" is already in "dev_dependencies". Will try to update the constraint.',
+            '"foo" is already in "dev_dependencies". '
+            'Will try to update the constraint.',
           ),
         );
 
@@ -726,7 +733,8 @@
         await pubAdd(
           args: ['foo:1.2.3', '--dev'],
           output: contains(
-            '"foo" is already in "dev_dependencies". Will try to update the constraint.',
+            '"foo" is already in "dev_dependencies". '
+            'Will try to update the constraint.',
           ),
         );
 
@@ -753,7 +761,8 @@
         await pubAdd(
           args: ['foo:>=1.2.2', '--dev'],
           output: contains(
-            '"foo" is already in "dev_dependencies". Will try to update the constraint.',
+            '"foo" is already in "dev_dependencies". '
+            'Will try to update the constraint.',
           ),
         );
 
diff --git a/test/cache/preload_test.dart b/test/cache/preload_test.dart
index a9577fe..6e9f0ed 100644
--- a/test/cache/preload_test.dart
+++ b/test/cache/preload_test.dart
@@ -20,8 +20,8 @@
     server.serve('foo', '2.0.0');
 
     await appDir(dependencies: {'foo': '^2.0.0'}).create();
-    // Do a `pub get` here to create a lock file in order to validate we later can
-    // `pub get --offline` with packages installed by `preload`.
+    // Do a `pub get` here to create a lock file in order to validate we later
+    // can `pub get --offline` with packages installed by `preload`.
     await pubGet();
 
     await runPub(args: ['cache', 'clean', '-f']);
@@ -64,8 +64,8 @@
   });
 
   test(
-      'installs package according to PUB_HOSTED_URL even on non-official server',
-      () async {
+      'installs package according to PUB_HOSTED_URL '
+      'even on non-official server', () async {
     final server = await servePackages();
     server.serve('foo', '1.0.0');
 
@@ -165,7 +165,8 @@
     await runPub(
       args: ['cache', 'preload', archivePath],
       error: contains(
-        'Found no `pubspec.yaml` in $archivePath. Is it a valid pub package archive?',
+        'Found no `pubspec.yaml` in $archivePath. '
+        'Is it a valid pub package archive?',
       ),
       exitCode: 1,
     );
@@ -183,7 +184,8 @@
     await runPub(
       args: ['cache', 'preload', archivePath],
       error: contains(
-        'Failed to load `pubspec.yaml` from `$archivePath`: Error on line 1, column 1',
+        'Failed to load `pubspec.yaml` from `$archivePath`: '
+        'Error on line 1, column 1',
       ),
       exitCode: 1,
     );
diff --git a/test/content_hash_test.dart b/test/content_hash_test.dart
index 31829ec..ca14a52 100644
--- a/test/content_hash_test.dart
+++ b/test/content_hash_test.dart
@@ -33,8 +33,8 @@
   });
 
   test(
-      'archive_sha256 is stored in lockfile upon download on legacy server without content hashes',
-      () async {
+      'archive_sha256 is stored in lockfile upon download on legacy server '
+      'without content hashes', () async {
     final server = await servePackages();
     server.serveContentHashes = false;
     server.serve('foo', '1.0.0');
@@ -83,7 +83,8 @@
       '1.0.0',
       contents: [file('new_file.txt', 'This file could be malicious.')],
     );
-    // Pub get will not revisit the file-listing if everything resolves, and only compare with a cached value.
+    // Pub get will not revisit the file-listing if everything resolves, and
+    // only compare with a cached value.
     await pubGet();
     // Deleting the version-listing cache will cause it to be refetched, and the
     // warning will happen.
@@ -93,7 +94,8 @@
       warning: allOf(
         contains('Cached version of foo-1.0.0 has wrong hash - redownloading.'),
         contains(
-          'The existing content-hash from pubspec.lock doesn\'t match contents for:',
+          'The existing content-hash '
+          'from pubspec.lock doesn\'t match contents for:',
         ),
         contains('* foo-1.0.0 from "${server.url}"\n'),
       ),
@@ -108,7 +110,8 @@
   });
 
   test(
-      'If content is updated on legacy server, and the download needs refreshing we warn and update the lockfile',
+      'If content is updated on legacy server, '
+      'and the download needs refreshing we warn and update the lockfile',
       () async {
     final server = await servePackages();
     server.serveContentHashes = false;
@@ -128,7 +131,8 @@
     await pubGet(
       warning: allOf([
         contains(
-          'The existing content-hash from pubspec.lock doesn\'t match contents for:',
+          'The existing content-hash from pubspec.lock '
+          'doesn\'t match contents for:',
         ),
         contains('* foo-1.0.0 from "${globalServer.url}"'),
       ]),
@@ -143,7 +147,8 @@
   });
 
   test(
-      'sha256 in cache is checked on pub get - warning and redownload on legacy server without content-hashes',
+      'sha256 in cache is checked on pub get '
+      '- warning and redownload on legacy server without content-hashes',
       () async {
     final server = await servePackages();
     server.serveContentHashes = false;
@@ -199,7 +204,8 @@
   });
 
   test(
-      'Legacy lockfile without content-hashes is updated with the hash on pub get on legacy server without content-hashes',
+      'Legacy lockfile without content-hashes is updated '
+      'with the hash on pub get on legacy server without content-hashes',
       () async {
     final server = await servePackages();
     server.serve('foo', '1.0.0');
@@ -226,8 +232,8 @@
   });
 
   test(
-      'Legacy lockfile without content-hashes is updated with the hash on pub get',
-      () async {
+      'Legacy lockfile without content-hashes '
+      'is updated with the hash on pub get', () async {
     final server = await servePackages();
     server.serve('foo', '1.0.0');
     server.serveContentHashes = true;
diff --git a/test/dart3_sdk_constraint_hack_test.dart b/test/dart3_sdk_constraint_hack_test.dart
index 921479b..993fea9 100644
--- a/test/dart3_sdk_constraint_hack_test.dart
+++ b/test/dart3_sdk_constraint_hack_test.dart
@@ -35,7 +35,8 @@
 
     await pubGet(
       error: contains(
-        'Because myapp requires SDK version >=2.12.0 <3.1.0, version solving failed',
+        'Because myapp requires SDK version >=2.12.0 <3.1.0, '
+        'version solving failed',
       ),
       environment: {'_PUB_TEST_SDK_VERSION': '3.5.0'},
     );
@@ -100,8 +101,9 @@
   });
 
   test('The bound of ">=3.0.0-dev <3.0.0" is not modified', () async {
-    // When the lower bound is a dev release of 3.0.0 the upper bound is treated literally, and not
-    //  converted to 3.0.0-0, therefore the rewrite to 4.0.0 doesn't happen.
+    // When the lower bound is a dev release of 3.0.0 the upper bound is treated
+    //  literally, and not converted to 3.0.0-0, therefore the rewrite to 4.0.0
+    //  doesn't happen.
     await d.dir(appPath, [
       d.pubspec({
         'name': 'myapp',
@@ -112,14 +114,15 @@
     await pubGet(
       environment: {'_PUB_TEST_SDK_VERSION': '3.5.0'},
       error: contains(
-        'Because myapp requires SDK version >=3.0.0-dev <3.0.0, version solving failed.',
+        'Because myapp requires SDK version >=3.0.0-dev <3.0.0, '
+        'version solving failed.',
       ),
     );
   });
 
   test(
-      'The bound of ">=2.12.0 <3.0.0" is not compatible with prereleases of dart 4',
-      () async {
+      'The bound of ">=2.12.0 <3.0.0" is not '
+      'compatible with prereleases of dart 4', () async {
     await d.dir(appPath, [
       d.pubspec({
         'name': 'myapp',
@@ -130,7 +133,8 @@
     await pubGet(
       environment: {'_PUB_TEST_SDK_VERSION': '4.0.0-alpha'},
       error: contains(
-        'Because myapp requires SDK version >=2.12.0 <4.0.0, version solving failed.',
+        'Because myapp requires SDK version >=2.12.0 <4.0.0, '
+        'version solving failed.',
       ),
     );
   });
@@ -155,7 +159,8 @@
     );
     await pubGet(
       error: contains(
-        'The lower bound of "sdk: \'>=2.10.0 <3.0.0\'" must be 2.12.0 or higher to enable null safety.'
+        'The lower bound of "sdk: \'>=2.10.0 <3.0.0\'" '
+        'must be 2.12.0 or higher to enable null safety.'
         '\nFor details, see https://dart.dev/null-safety',
       ),
     );
@@ -171,7 +176,8 @@
 
     await pubGet(
       error: contains(
-        'Because myapp requires SDK version >=2.19.1 <3.0.0, version solving failed.',
+        'Because myapp requires SDK version >=2.19.1 <3.0.0, '
+        'version solving failed.',
       ),
       environment: {'_PUB_TEST_SDK_VERSION': '2.19.0'},
     );
diff --git a/test/dependency_services/dependency_services_test.dart b/test/dependency_services/dependency_services_test.dart
index 028e8a8..f7339ec 100644
--- a/test/dependency_services/dependency_services_test.dart
+++ b/test/dependency_services/dependency_services_test.dart
@@ -76,9 +76,10 @@
     final exitCode = await process.exitCode;
 
     final pipe = ' echo ${filterUnstableText(escapeShellArgument(stdin))} |';
+    final argString = args.map(escapeShellArgument).join(' ');
     buffer.writeln(
       [
-        '\$$pipe dependency_services ${args.map(escapeShellArgument).join(' ')}',
+        '\$$pipe dependency_services $argString',
         ...await outLines,
         ...(await errLines).map((e) => '[STDERR] $e'),
         if (exitCode != 0) '[EXIT CODE] $exitCode',
diff --git a/test/descriptor/package_config.dart b/test/descriptor/package_config.dart
index cb8a4fe..fb7996d 100644
--- a/test/descriptor/package_config.dart
+++ b/test/descriptor/package_config.dart
@@ -83,7 +83,8 @@
                 .having(
                   (p0) => p0.languageVersion,
                   'languageVersion',
-                  // If the expected entry has no language-version we don't check it.
+                  // If the expected entry has no language-version we don't
+                  // check it.
                   p.languageVersion ?? anything,
                 )
                 .having((p0) => p0.rootUri, 'rootUri', p.rootUri)
diff --git a/test/embedding/ensure_pubspec_resolved.dart b/test/embedding/ensure_pubspec_resolved.dart
index 37dc984..5e8ab33 100644
--- a/test/embedding/ensure_pubspec_resolved.dart
+++ b/test/embedding/ensure_pubspec_resolved.dart
@@ -38,7 +38,8 @@
     });
 
     test(
-        'does not require a pub get if a `flutter_gen` package is injected into package_config.json',
+        'does not require a pub get '
+        'if a `flutter_gen` package is injected into package_config.json',
         () async {
       await d.dir('bar', [
         d.pubspec({'name': 'bar'}),
@@ -341,7 +342,8 @@
           d.libPubspec('bar', '1.0.0', deps: {'foo': '2.0.0'}),
         ]).create();
 
-        // To ensure the timestamp is strictly later we need to touch again here.
+        // To ensure the timestamp is strictly later we need to touch again
+        // here.
         await _touch(p.join(d.sandbox, 'bar', 'pubspec.yaml'));
 
         await _implicitPubGet('../bar/pubspec.yaml has changed '
@@ -349,8 +351,8 @@
       });
 
       test(
-          "a path dependency's language version doesn't match the package_config.json",
-          () async {
+          "a path dependency's language version "
+          "doesn't match the package_config.json", () async {
         await d.dir('bar', [
           d.libPubspec(
             'bar',
@@ -381,7 +383,8 @@
             sdk: '>= 2.100.0 <=4.0.0', // tests runs with '3.1.2+3'
           ),
         ]).create();
-        // To ensure the timestamp is strictly later we need to touch again here.
+        // To ensure the timestamp is strictly later we need to touch again
+        // here.
         await _touch(p.join(d.sandbox, 'bar', 'pubspec.yaml'));
 
         await _implicitPubGet('../bar/pubspec.yaml has changed '
diff --git a/test/embedding/get_executable_for_command.dart b/test/embedding/get_executable_for_command.dart
index 6c28c62..2994af8 100644
--- a/test/embedding/get_executable_for_command.dart
+++ b/test/embedding/get_executable_for_command.dart
@@ -54,10 +54,11 @@
       true,
       reason: '${p.join(root, executable)} should exist',
     );
+    final filtered = filterUnstableText(packageConfig ?? 'No package config');
     expect(
       output,
       contains(
-        'Package config: ${filterUnstableText(packageConfig ?? 'No package config')}\n',
+        'Package config: $filtered\n',
       ),
     );
   }
@@ -153,6 +154,7 @@
             'Error on line 1, column 9 of ../foo/pubspec.yaml: "name" field must be a valid Dart identifier.',
           ),
           contains(
+            // ignore: lines_longer_than_80_chars
             '{"name":"broken name","environment":{"sdk":"$defaultSdkConstraint"}}',
           ),
         ),
diff --git a/test/get/enforce_lockfile_test.dart b/test/get/enforce_lockfile_test.dart
index 75c3ee1..e15f0c4 100644
--- a/test/get/enforce_lockfile_test.dart
+++ b/test/get/enforce_lockfile_test.dart
@@ -88,10 +88,11 @@
       ),
       error: allOf(
         contains(
-          'Unable to satisfy `$examplePubspec` using `$examplePubspecLock` in `$example`.',
+          'Unable to satisfy `$examplePubspec` '
+          'using `$examplePubspecLock` in `$example`.',
         ),
-        contains(
-            'To update `$examplePubspecLock` run `dart pub get` in `$example` without\n'
+        contains('To update `$examplePubspecLock` run '
+            '`dart pub get` in `$example` without\n'
             '`--enforce-lockfile`.'),
       ),
       exitCode: DATA,
@@ -162,7 +163,8 @@
       error: allOf(
         contains('Cached version of foo-1.0.0 has wrong hash - redownloading.'),
         contains(
-          'The existing content-hash from pubspec.lock doesn\'t match contents for:',
+          'The existing content-hash from pubspec.lock '
+          'doesn\'t match contents for:',
         ),
         contains(
           ' * foo-1.0.0 from "${server.url}"',
@@ -176,8 +178,8 @@
   });
 
   test(
-      'Refuses to get if archive on legacy server doesn\'t have hash corresponding to lockfile',
-      () async {
+      'Refuses to get if archive on legacy server '
+      'doesn\'t have hash corresponding to lockfile', () async {
     final server = await servePackages();
     server.serveContentHashes = false;
     server.serve('foo', '1.0.0');
diff --git a/test/get/git/check_out_test.dart b/test/get/git/check_out_test.dart
index ac23e1b..d3a2020 100644
--- a/test/get/git/check_out_test.dart
+++ b/test/get/git/check_out_test.dart
@@ -37,8 +37,8 @@
     expect(
       dig<String>(lockfile, ['packages', 'foo', 'description', 'url']),
       '../foo.git',
-      reason:
-          'The relative path should be preserved, and be a url (forward slashes on all platforms)',
+      reason: 'The relative path should be preserved, '
+          'and be a url (forward slashes on all platforms)',
     );
 
     await d.dir(cachePath, [
diff --git a/test/get/git/check_out_transitive_test.dart b/test/get/git/check_out_transitive_test.dart
index 49dc027..339416d 100644
--- a/test/get/git/check_out_transitive_test.dart
+++ b/test/get/git/check_out_transitive_test.dart
@@ -142,8 +142,8 @@
   });
 
   test(
-      'can have relative path dependencies to the repo root dir transitively from Git',
-      () async {
+      'can have relative path dependencies '
+      'to the repo root dir transitively from Git', () async {
     ensureGit();
 
     await d.git('foo.git', [
@@ -176,8 +176,8 @@
   });
 
   test(
-      'cannot have relative path dependencies transitively from Git to outside the repo',
-      () async {
+      'cannot have relative path dependencies transitively from Git '
+      'to outside the repo', () async {
     ensureGit();
 
     await d.git('foo.git', [
diff --git a/test/get/git/clean_invalid_git_repo_cache_test.dart b/test/get/git/clean_invalid_git_repo_cache_test.dart
index 42a7a3c..c69c5eb 100644
--- a/test/get/git/clean_invalid_git_repo_cache_test.dart
+++ b/test/get/git/clean_invalid_git_repo_cache_test.dart
@@ -10,7 +10,8 @@
 import '../../descriptor.dart' as d;
 import '../../test_pub.dart';
 
-/// Invalidates a git clone in the pub-cache, by recreating it as empty-directory.
+/// Invalidates a git clone in the pub-cache, by recreating it as
+/// empty-directory.
 void _invalidateGitCache(String repo) {
   final cacheDir = p.join(d.sandbox, p.joinAll([cachePath, 'git', 'cache']));
   final fooCacheDir = Directory(cacheDir).listSync().firstWhere((entity) {
diff --git a/test/get/git/path_test.dart b/test/get/git/path_test.dart
index 957bdeb..41c8b0c 100644
--- a/test/get/git/path_test.dart
+++ b/test/get/git/path_test.dart
@@ -112,7 +112,8 @@
 
       await pubGet(
         error: contains(
-          'Invalid description in the "myapp" pubspec on the "sub" dependency: The \'path\' field of the description must be a relative path URL.',
+          'Invalid description in the "myapp" pubspec on the "sub" dependency: '
+          'The \'path\' field of the description must be a relative path URL.',
         ),
         exitCode: exit_codes.DATA,
       );
@@ -128,7 +129,8 @@
 
       await pubGet(
         error: contains(
-          'Invalid description in the "myapp" pubspec on the "sub" dependency: The \'path\' field of the description must be a relative path URL.',
+          'Invalid description in the "myapp" pubspec on the "sub" dependency: '
+          'The \'path\' field of the description must be a relative path URL.',
         ),
         exitCode: exit_codes.DATA,
       );
@@ -144,7 +146,8 @@
 
       await pubGet(
         error: contains(
-          'Invalid description in the "myapp" pubspec on the "sub" dependency: The \'path\' field of the description must be a relative path URL.',
+          'Invalid description in the "myapp" pubspec on the "sub" dependency: '
+          'The \'path\' field of the description must be a relative path URL.',
         ),
         exitCode: exit_codes.DATA,
       );
@@ -161,7 +164,8 @@
 
       await pubGet(
         error: contains(
-          'Invalid description in the "myapp" pubspec on the "sub" dependency: The \'path\' field of the description must be a relative path URL.',
+          'Invalid description in the "myapp" pubspec on the "sub" dependency: '
+          'The \'path\' field of the description must be a relative path URL.',
         ),
         exitCode: exit_codes.DATA,
       );
@@ -181,7 +185,8 @@
 
       await pubGet(
         error: contains(
-          'Invalid description in the "myapp" pubspec on the "sub" dependency: The \'path\' field of the description must be a relative path URL.',
+          'Invalid description in the "myapp" pubspec on the "sub" dependency: '
+          'The \'path\' field of the description must be a relative path URL.',
         ),
         exitCode: exit_codes.DATA,
       );
diff --git a/test/get/hosted/warn_about_discontinued_test.dart b/test/get/hosted/warn_about_discontinued_test.dart
index 3ceda71..96f998e 100644
--- a/test/get/hosted/warn_about_discontinued_test.dart
+++ b/test/get/hosted/warn_about_discontinued_test.dart
@@ -217,7 +217,8 @@
       (shelf.Request request) => shelf.Response.notFound('Not found'),
     );
 
-    /// Even if we fail to get status we still report success if versions don't unlock.
+    /// Even if we fail to get status we still report success if versions don't
+    /// unlock.
     await pubGet();
   });
 }
diff --git a/test/get/path/empty_pubspec_test.dart b/test/get/path/empty_pubspec_test.dart
index e984a9a..9e3ff28 100644
--- a/test/get/path/empty_pubspec_test.dart
+++ b/test/get/path/empty_pubspec_test.dart
@@ -24,8 +24,8 @@
 
     await pubGet(
       exitCode: exit_codes.DATA,
-      error:
-          'Error on line 1, column 1 of ${p.join('..', 'foo', 'pubspec.yaml')}: '
+      error: 'Error on line 1, column 1 of '
+          '${p.join('..', 'foo', 'pubspec.yaml')}: '
           'Missing the required "name" field.',
     );
   });
diff --git a/test/get/path/no_pubspec_test.dart b/test/get/path/no_pubspec_test.dart
index 076db44..1d08702 100644
--- a/test/get/path/no_pubspec_test.dart
+++ b/test/get/path/no_pubspec_test.dart
@@ -25,7 +25,8 @@
 
     await pubGet(
       error: 'Because myapp depends on foo from path which doesn\'t exist '
-          '(No pubspec.yaml found for package foo in $fooPath.), version solving failed.',
+          '(No pubspec.yaml found for package foo in $fooPath.), '
+          'version solving failed.',
       exitCode: exit_codes.NO_INPUT,
     );
   });
diff --git a/test/get/path/path_is_file_test.dart b/test/get/path/path_is_file_test.dart
index 8fbae78..f6f8c41 100644
--- a/test/get/path/path_is_file_test.dart
+++ b/test/get/path/path_is_file_test.dart
@@ -27,7 +27,8 @@
 
     await pubGet(
       error: 'Because myapp depends on foo from path which doesn\'t exist '
-          '(Path dependency for package foo must refer to a directory, not a file. Was "$dummyPath".), version solving failed.',
+          '(Path dependency for package foo must refer to a directory, '
+          'not a file. Was "$dummyPath".), version solving failed.',
       exitCode: exit_codes.NO_INPUT,
     );
   });
diff --git a/test/get/summary_only_environment_test.dart b/test/get/summary_only_environment_test.dart
index 3553c8d..e9c39d8 100644
--- a/test/get/summary_only_environment_test.dart
+++ b/test/get/summary_only_environment_test.dart
@@ -13,8 +13,9 @@
     await d.appDir(dependencies: {'foo': 'any'}).create();
 
     await pubGet(
-      output:
-          'Resolving dependencies...\nDownloading packages...\nGot dependencies.',
+      output: 'Resolving dependencies...\n'
+          'Downloading packages...\n'
+          'Got dependencies.',
       silent: contains('+ foo 1.0.0'),
       environment: {'PUB_SUMMARY_ONLY': '1'},
     );
diff --git a/test/get/unknown_sdk_test.dart b/test/get/unknown_sdk_test.dart
index c13db54..ed9c4fd 100644
--- a/test/get/unknown_sdk_test.dart
+++ b/test/get/unknown_sdk_test.dart
@@ -18,7 +18,8 @@
 
     await pubGet(
       error: contains(
-        "Error on line 1, column 32 of pubspec.yaml: pubspec.yaml refers to an unknown sdk 'foo'.",
+        'Error on line 1, column 32 of pubspec.yaml: '
+        "pubspec.yaml refers to an unknown sdk 'foo'.",
       ),
       exitCode: exit_codes.DATA,
     );
diff --git a/test/global/activate/activate_hosted_after_git_test.dart b/test/global/activate/activate_hosted_after_git_test.dart
index fcdff96..0ff1f90 100644
--- a/test/global/activate/activate_hosted_after_git_test.dart
+++ b/test/global/activate/activate_hosted_after_git_test.dart
@@ -30,7 +30,8 @@
       args: ['global', 'activate', 'foo'],
       output: allOf([
         contains(
-          'Package foo is currently active from Git repository "..${separator}foo.git".',
+          'Package foo is currently active from Git repository '
+          '"..${separator}foo.git".',
         ),
         contains('* foo 2.0.0 (was 1.0.0 from git ..${separator}foo.git at'),
         contains('Activated foo 2.0.0.'),
diff --git a/test/global/activate/git_package_test.dart b/test/global/activate/git_package_test.dart
index 5373e87..3ad50b7 100644
--- a/test/global/activate/git_package_test.dart
+++ b/test/global/activate/git_package_test.dart
@@ -26,7 +26,8 @@
         // Specific revision number goes here.
         endsWith('Building package executables...\n'
             'Built foo:foo.\n'
-            'Activated foo 1.0.0 from Git repository "..${p.separator}foo.git".'),
+            'Activated foo 1.0.0 from Git repository '
+            '"..${p.separator}foo.git".'),
       ),
     );
   });
@@ -84,7 +85,8 @@
         contains('in sub'),
         endsWith('Building package executables...\n'
             'Built sub:sub.\n'
-            'Activated sub 2.0.0 from Git repository "..${p.separator}foo.git".'),
+            'Activated sub 2.0.0 from Git repository '
+            '"..${p.separator}foo.git".'),
       ),
     );
     await runPub(
diff --git a/test/global/binstubs/binstub_runs_global_run_if_no_snapshot_test.dart b/test/global/binstubs/binstub_runs_global_run_if_no_snapshot_test.dart
index 8888c8f..85b92c4 100644
--- a/test/global/binstubs/binstub_runs_global_run_if_no_snapshot_test.dart
+++ b/test/global/binstubs/binstub_runs_global_run_if_no_snapshot_test.dart
@@ -37,8 +37,8 @@
   });
 
   test(
-      'the binstubs of hosted package runs pub global run if there is no snapshot',
-      () async {
+      'the binstubs of hosted package runs pub global run '
+      'if there is no snapshot', () async {
     final server = await servePackages();
     server.serve(
       'foo',
diff --git a/test/global/binstubs/outdated_snapshot_test.dart b/test/global/binstubs/outdated_snapshot_test.dart
index 4511a0a..36f9b50 100644
--- a/test/global/binstubs/outdated_snapshot_test.dart
+++ b/test/global/binstubs/outdated_snapshot_test.dart
@@ -57,8 +57,8 @@
       environment: getEnvironment(),
     );
 
-    // We don't get `Building package executable...` because we are running through
-    // the binstub.
+    // We don't get `Building package executable...` because we are running
+    // through the binstub.
     expect(process.stdout, emitsThrough('ok [arg1, arg2]'));
     await process.shouldExit();
 
@@ -69,7 +69,8 @@
     //     d.file(
     //         'script.dart-$versionSuffix.snapshot',
     //         isNot(equals(
-    //             readBinaryFile(testAssetPath('out-of-date-$versionSuffix.snapshot')))))
+    //             readBinaryFile(testAssetPath(
+    //                 'out-of-date-$versionSuffix.snapshot')))))
     //   ])
     // ]).validate();
   });
diff --git a/test/global/deactivate/git_package_test.dart b/test/global/deactivate/git_package_test.dart
index e49fa1c..59dd322 100644
--- a/test/global/deactivate/git_package_test.dart
+++ b/test/global/deactivate/git_package_test.dart
@@ -21,8 +21,8 @@
 
     await runPub(
       args: ['global', 'deactivate', 'foo'],
-      output:
-          'Deactivated package foo 1.0.0 from Git repository "..${separator}foo.git".',
+      output: 'Deactivated package foo 1.0.0 from Git repository '
+          '"..${separator}foo.git".',
     );
   });
 }
diff --git a/test/golden_file.dart b/test/golden_file.dart
index 21d126c..65b62b4 100644
--- a/test/golden_file.dart
+++ b/test/golden_file.dart
@@ -58,13 +58,14 @@
       _currentTestFile.replaceAll(RegExp(r'\.dart$'), ''),
       from: p.join(p.current, 'test'),
     );
+    final sanitizedName = _testName.replaceAll(RegExp(r'[<>:"/\|?*%#]'), '~');
     _goldenFilePath = p.join(
       'test',
       'testdata',
       'goldens',
       rel,
       // Sanitize the name, and add .ans or .txt.
-      '${_testName.replaceAll(RegExp(r'[<>:"/\|?*%#]'), '~')}.${colors ? 'ans' : 'txt'}',
+      '$sanitizedName.${colors ? 'ans' : 'txt'}',
     );
     _goldenFile = File(_goldenFilePath);
     _header = '# GENERATED BY: ${p.relative(_currentTestFile)}\n\n';
diff --git a/test/hosted/fail_gracefully_on_bad_version_listing_response_test.dart b/test/hosted/fail_gracefully_on_bad_version_listing_response_test.dart
index 67e13a3..d247245 100644
--- a/test/hosted/fail_gracefully_on_bad_version_listing_response_test.dart
+++ b/test/hosted/fail_gracefully_on_bad_version_listing_response_test.dart
@@ -15,7 +15,8 @@
 void main() {
   forBothPubGetAndUpgrade((command) {
     test(
-        'fails gracefully if the package server responds with broken package listings',
+        'fails gracefully '
+        'if the package server responds with broken package listings',
         () async {
       final server = await servePackages();
       server.serve('foo', '1.2.3');
diff --git a/test/hosted/version_negotiation_test.dart b/test/hosted/version_negotiation_test.dart
index fea2ef5..657b435 100644
--- a/test/hosted/version_negotiation_test.dart
+++ b/test/hosted/version_negotiation_test.dart
@@ -60,9 +60,9 @@
 
       expect(
         pub.stderr,
-        emitsLines(
-            'Pub 3.1.2+3 is incompatible with the current version of localhost.\n'
-            'Upgrade pub to the latest version and try again.'),
+        emitsLines('''
+Pub 3.1.2+3 is incompatible with the current version of localhost.
+Upgrade pub to the latest version and try again.'''),
       );
     });
   });
diff --git a/test/ignore_test.dart b/test/ignore_test.dart
index 7627cd1..0563bdb 100644
--- a/test/ignore_test.dart
+++ b/test/ignore_test.dart
@@ -129,8 +129,9 @@
       expect(
         ret.exitCode,
         equals(0),
-        reason:
-            'Running "git init" failed. StdErr: ${ret.stderr} StdOut: ${ret.stdout}',
+        reason: 'Running "git init" failed. '
+            'StdErr: ${ret.stderr} '
+            'StdOut: ${ret.stdout}',
       );
     });
 
diff --git a/test/io_test.dart b/test/io_test.dart
index a8ffa2e..c4ed470 100644
--- a/test/io_test.dart
+++ b/test/io_test.dart
@@ -27,7 +27,8 @@
           (e) =>
               e is ApplicationException &&
               e.message.contains(
-                'Pub failed to run subprocess `$nonExisting`: ProcessException:',
+                'Pub failed to run subprocess `$nonExisting`: '
+                'ProcessException:',
               ),
         ),
       );
@@ -338,10 +339,12 @@
         await extractTarGz(
           Stream.fromIterable(
             [
-              base64Decode(
-                  'H4sIAP2weF4AA+3S0QqCMBiG4V2KeAE1nfuF7maViNBqzDyQ6N4z6yCIogOtg97ncAz2wTvfuxCW'
-                  'alZ6UFqttIiUYpXObWlzM57fqcyIkcxoU2ZKZyYvtErsvLNuuvboYpKotqm7uPUv74XYeBf7Oh66'
-                  '8I1dX+LH/qFbt6HaLHrnd9O/cQ0sxZv++UP/Qob+1srQX08/5dmf9z+le+erdJWOHyE9/3oPAAAA'
+              base64Decode('H4sIAP2weF4AA+3S0QqCMBiG4V2KeAE1nfuF7m'
+                  'aViNBqzDyQ6N4z6yCIogOtg97ncAz2wTvfuxCW'
+                  'alZ6UFqttIiUYpXObWlzM57fqcyIkcxoU2ZKZy'
+                  'YvtErsvLNuuvboYpKotqm7uPUv74XYeBf7Oh66'
+                  '8I1dX+LH/qFbt6HaLHrnd9O/cQ0sxZv++UP/Qo'
+                  'b+1srQX08/5dmf9z+le+erdJWOHyE9/3oPAAAA'
                   'AAAAAAAAAAAAgM9dALkoaRMAKAAA'),
             ],
           ),
diff --git a/test/lish/archive_contents_test.dart b/test/lish/archive_contents_test.dart
index 61a0bf0..29499e5 100644
--- a/test/lish/archive_contents_test.dart
+++ b/test/lish/archive_contents_test.dart
@@ -23,8 +23,8 @@
 
 void main() {
   test(
-      'archives and uploads empty directories in package. Maintains the executable bit',
-      () async {
+      'archives and uploads empty directories in package. '
+      'Maintains the executable bit', () async {
     await d.validPackage().create();
     await d.dir(appPath, [
       d.dir('tool', [d.file('tool.sh', 'commands...')]),
@@ -75,7 +75,8 @@
           if (entry.name.endsWith('tool.sh')) {
             expect(
               entry.header.mode
-                  // chmod +x doesn't sets the executable bit for other users on some platforms only.
+                  // chmod +x doesn't sets the executable bit for other users on
+                  // some platforms only.
                   |
                   1,
               _defaultMode | _executableMask,
diff --git a/test/lish/cloud_storage_upload_provides_an_error_test.dart b/test/lish/cloud_storage_upload_provides_an_error_test.dart
index be0ba9f..071ca45 100644
--- a/test/lish/cloud_storage_upload_provides_an_error_test.dart
+++ b/test/lish/cloud_storage_upload_provides_an_error_test.dart
@@ -38,7 +38,8 @@
     expect(
       pub.stderr,
       emits(
-        'Server message: Your proposed upload is larger than the maximum object size specified in your Policy Document.',
+        'Server message: Your proposed upload is larger than '
+        'the maximum object size specified in your Policy Document.',
       ),
     );
     expect(
diff --git a/test/lish/force_does_not_publish_if_there_are_errors_test.dart b/test/lish/force_does_not_publish_if_there_are_errors_test.dart
index 6523874..aaf71b6 100644
--- a/test/lish/force_does_not_publish_if_there_are_errors_test.dart
+++ b/test/lish/force_does_not_publish_if_there_are_errors_test.dart
@@ -25,7 +25,8 @@
     expect(
       pub.stderr,
       emitsThrough(
-        "Sorry, your package is missing a requirement and can't be published yet.",
+        'Sorry, your package is missing a requirement '
+        "and can't be published yet.",
       ),
     );
   });
diff --git a/test/lish/force_publishes_if_there_are_warnings_test.dart b/test/lish/force_publishes_if_there_are_warnings_test.dart
index ceded0f..a09b75b 100644
--- a/test/lish/force_publishes_if_there_are_warnings_test.dart
+++ b/test/lish/force_publishes_if_there_are_warnings_test.dart
@@ -48,7 +48,8 @@
       allOf([
         contains('Package validation found the following potential issue:'),
         contains(
-          '* Your dependency on "foo" should have a version constraint. For example:',
+          '* Your dependency on "foo" should have a version constraint. '
+          'For example:',
         ),
       ]),
     );
diff --git a/test/lish/skip_validation_test.dart b/test/lish/skip_validation_test.dart
index 885b580..9788814 100644
--- a/test/lish/skip_validation_test.dart
+++ b/test/lish/skip_validation_test.dart
@@ -16,8 +16,8 @@
 
 void main() {
   test(
-      'with --skip-validation dependency resolution and validations are skipped.',
-      () async {
+      'with --skip-validation dependency resolution '
+      'and validations are skipped.', () async {
     await servePackages();
     await d.validPackage().create();
     await d.dir(appPath, [
diff --git a/test/outdated/outdated_test.dart b/test/outdated/outdated_test.dart
index ff9ed28..26a81a6 100644
--- a/test/outdated/outdated_test.dart
+++ b/test/outdated/outdated_test.dart
@@ -749,8 +749,8 @@
   });
 
   testWithGolden(
-      'latest version reported while locked on a prerelease can be a prerelease',
-      (ctx) async {
+      'latest version reported while locked on a prerelease '
+      'can be a prerelease', (ctx) async {
     await servePackages()
       ..serve('foo', '0.9.0')
       ..serve('foo', '1.0.0-dev.1')
diff --git a/test/package_list_files_test.dart b/test/package_list_files_test.dart
index ab2d949..1f618a6 100644
--- a/test/package_list_files_test.dart
+++ b/test/package_list_files_test.dart
@@ -135,7 +135,8 @@
           (e) => e.message,
           'message',
           contains(
-            'Pub does not support publishing packages with non-resolving symlink:',
+            'Pub does not support publishing packages with '
+            'non-resolving symlink:',
           ),
         ),
       ),
@@ -164,7 +165,8 @@
           (e) => e.message,
           'message',
           contains(
-            'Pub does not support publishing packages with non-resolving symlink:',
+            'Pub does not support publishing packages with '
+            'non-resolving symlink:',
           ),
         ),
       ),
diff --git a/test/pinned_dependency_hint_test.dart b/test/pinned_dependency_hint_test.dart
index 2d737d6..d076c1f 100644
--- a/test/pinned_dependency_hint_test.dart
+++ b/test/pinned_dependency_hint_test.dart
@@ -36,7 +36,8 @@
     await pubGet(
       environment: {'FLUTTER_ROOT': p.join(d.sandbox, 'flutter')},
       error: contains(
-        'Note: tool is pinned to version 1.0.0 by flutter_foo from the flutter SDK.',
+        'Note: tool is pinned to version 1.0.0 by '
+        'flutter_foo from the flutter SDK.',
       ),
     );
   });
@@ -67,7 +68,8 @@
     await pubGet(
       environment: {'FLUTTER_ROOT': p.join(d.sandbox, 'flutter')},
       error: contains(
-        'Note: tool is pinned to version 1.0.0 by flutter_foo from the flutter SDK.',
+        'Note: tool is pinned to version 1.0.0 by '
+        'flutter_foo from the flutter SDK.',
       ),
     );
   });
diff --git a/test/pub_get_and_upgrade_test.dart b/test/pub_get_and_upgrade_test.dart
index 61dfa45..08e9c5c 100644
--- a/test/pub_get_and_upgrade_test.dart
+++ b/test/pub_get_and_upgrade_test.dart
@@ -18,7 +18,8 @@
         await pubCommand(
           command,
           error: contains(
-            'Found no `pubspec.yaml` file in `${d.path(appPath)}` or parent directories',
+            'Found no `pubspec.yaml` file in `${d.path(appPath)}` '
+            'or parent directories',
           ),
           exitCode: exit_codes.NO_INPUT,
         );
diff --git a/test/pubspec_overrides_test.dart b/test/pubspec_overrides_test.dart
index 69c216a..291b9c8 100644
--- a/test/pubspec_overrides_test.dart
+++ b/test/pubspec_overrides_test.dart
@@ -79,8 +79,8 @@
     );
   });
   test(
-      "An empty pubspec_overrides.yaml doesn't shadow overrides from pubspec.yaml",
-      () async {
+      "An empty pubspec_overrides.yaml doesn't shadow overrides "
+      'from pubspec.yaml', () async {
     await servePackages()
       ..serve('lib', '1.0.0')
       ..serve('lib', '2.0.0');
diff --git a/test/pubspec_test.dart b/test/pubspec_test.dart
index 899c1db..5db5bf3 100644
--- a/test/pubspec_test.dart
+++ b/test/pubspec_test.dart
@@ -470,7 +470,8 @@
         (pubspec) => pubspec.dependencies,
         expectedContains:
             'Invalid description in the "pkg" pubspec on the "from_path" '
-            'dependency: "non_local_path" is a relative path, but this isn\'t a '
+            'dependency: "non_local_path" is a relative path, '
+            'but this isn\'t a '
             'local pubspec.',
       );
     });
@@ -651,8 +652,8 @@
       url: https://example.org/pub/
 ''',
             (pubspec) => pubspec.dependencies,
-            expectedContains:
-                "The 'name' key must have a string value without a minimum Dart "
+            expectedContains: "The 'name' key must have a "
+                'string value without a minimum Dart '
                 'SDK constraint of 2.15.',
           );
         });
@@ -668,8 +669,8 @@
     hosted: http://pub.example.org
 ''',
               (pubspec) => pubspec.dependencies,
-              expectedContains:
-                  'Using `hosted: <url>` is only supported with a minimum SDK constraint of 2.15.',
+              expectedContains: 'Using `hosted: <url>` is only supported '
+                  'with a minimum SDK constraint of 2.15.',
             );
           },
         );
@@ -1080,7 +1081,8 @@
       url: '::'
 ''',
           (pubspecOverrides) => pubspecOverrides.dependencyOverrides,
-          'Error on line 4, column 7 of ${Platform.pathSeparator}pubspec_overrides.yaml',
+          'Error on line 4, column 7 of '
+              '${Platform.pathSeparator}pubspec_overrides.yaml',
         );
       });
 
diff --git a/test/rate_limited_scheduler_test.dart b/test/rate_limited_scheduler_test.dart
index 3a387c3..082eaa1 100644
--- a/test/rate_limited_scheduler_test.dart
+++ b/test/rate_limited_scheduler_test.dart
@@ -209,8 +209,8 @@
         () async {
           await isBeingProcessed['a']!.future;
           await isBeingProcessed['b']!.future;
-          // This will put 'c' in front of the queue, but in a zone with zoneValue
-          // bound to S.
+          // This will put 'c' in front of the queue, but in a zone with
+          // zoneValue bound to S.
           final f = expectLater(scheduler.schedule('c'), completion('S'));
           completers['a']!.complete();
           completers['b']!.complete();
diff --git a/test/run/precompile_test.dart b/test/run/precompile_test.dart
index 856f0bd..46a19b8 100644
--- a/test/run/precompile_test.dart
+++ b/test/run/precompile_test.dart
@@ -46,8 +46,8 @@
   });
 
   test(
-      "`pub run` doesn't write about precompilation when a terminal is not attached",
-      () async {
+      "`pub run` doesn't write about precompilation "
+      'when a terminal is not attached', () async {
     await setupForPubRunToPrecompile();
 
     final pub = await pubRun(args: ['test'], verbose: false);
diff --git a/test/sdk_test.dart b/test/sdk_test.dart
index 39b3fa2..531fc60 100644
--- a/test/sdk_test.dart
+++ b/test/sdk_test.dart
@@ -340,7 +340,8 @@
           environment: {'DART_ROOT': p.join(d.sandbox, 'dart')},
           error: contains(
               'Unsupported operation: Only SDK packages are allowed as regular '
-              'dependencies for packages vendored by the dart SDK, but the `foo` '
+              'dependencies for packages vendored '
+              'by the dart SDK, but the `foo` '
               'package has a hosted dependency on `bar`.'),
         );
       });
diff --git a/test/snapshot_test.dart b/test/snapshot_test.dart
index c2dea39..1d623e3 100644
--- a/test/snapshot_test.dart
+++ b/test/snapshot_test.dart
@@ -284,8 +284,8 @@
 
         final process = await pubRun(args: ['foo:hello']);
 
-        // In the real world this would just print "hello!", but since we collect
-        // all output we see the precompilation messages as well.
+        // In the real world this would just print "hello!", but since we
+        // collect all output we see the precompilation messages as well.
         expect(process.stdout, emits('Building package executable...'));
         expect(process.stdout, emitsThrough('hello!'));
         await process.shouldExit();
diff --git a/test/solve_suggestions_test.dart b/test/solve_suggestions_test.dart
index 39cb66f..fccf1a7 100644
--- a/test/solve_suggestions_test.dart
+++ b/test/solve_suggestions_test.dart
@@ -84,10 +84,12 @@
       error: allOf(
         [
           contains(
-            '* Consider downgrading your constraint on foo: dart pub add foo:^0.9.0',
+            '* Consider downgrading your constraint on foo: '
+            'dart pub add foo:^0.9.0',
           ),
           contains(
-            '* Try upgrading your constraint on bar: dart pub add dev:bar:^2.0.0',
+            '* Try upgrading your constraint on bar: '
+            'dart pub add dev:bar:^2.0.0',
           ),
         ],
       ),
@@ -133,7 +135,8 @@
     ]).create();
     await pubGet(
       error: contains(
-        '* Try updating the following constraints: dart pub add dev:bar:^2.0.0 foo:^2.0.0',
+        '* Try updating the following constraints: '
+        'dart pub add dev:bar:^2.0.0 foo:^2.0.0',
       ),
     );
   });
@@ -170,7 +173,8 @@
     ]).create();
     await pubGet(
       error: contains(
-        '* Try an upgrade of your constraints: dart pub upgrade --major-versions',
+        '* Try an upgrade of your constraints: '
+        'dart pub upgrade --major-versions',
       ),
     );
   });
diff --git a/test/test_pub.dart b/test/test_pub.dart
index 616590f..160c155 100644
--- a/test/test_pub.dart
+++ b/test/test_pub.dart
@@ -471,7 +471,8 @@
 final String _pubRoot = (() {
   if (!fileExists(p.join('bin', 'pub.dart'))) {
     throw StateError(
-      "Current working directory (${p.current} is not pub's root. Run tests from pub's root.",
+      "Current working directory (${p.current} is not pub's root. "
+      "Run tests from pub's root.",
     );
   }
   return p.current;
@@ -677,8 +678,8 @@
 
 /// Creates a lock file for [package] without running `pub get`.
 ///
-/// [dependenciesInSandBox] is a list of path dependencies to be found in the sandbox
-/// directory.
+/// [dependenciesInSandBox] is a list of path dependencies to be found in the
+/// sandbox directory.
 ///
 /// [hosted] is a list of package names to version strings for dependencies on
 /// hosted packages.
@@ -977,8 +978,10 @@
   //       .join('\n'));
   // }
   final pipe = stdin == null ? '' : ' echo ${escapeShellArgument(stdin)} |';
+  final joinedArgs =
+      args.map(filterUnstableText).map(escapeShellArgument).join(' ');
   buffer.writeln(
-    '\$$pipe pub ${args.map(filterUnstableText).map(escapeShellArgument).join(' ')}',
+    '\$$pipe pub $joinedArgs',
   );
   for (final line in await process.stdout.rest.toList()) {
     buffer.writeln(filterUnstableText(line));
diff --git a/test/token/add_token_test.dart b/test/token/add_token_test.dart
index 4fea8ab..7e7ab44 100644
--- a/test/token/add_token_test.dart
+++ b/test/token/add_token_test.dart
@@ -154,8 +154,8 @@
   });
 
   test(
-      'with non-secure localhost url creates pub-tokens.json that contains token',
-      () async {
+      'with non-secure localhost url creates pub-tokens.json '
+      'that contains token', () async {
     await d.dir(configPath).create();
 
     await runPub(
diff --git a/test/unpack_test.dart b/test/unpack_test.dart
index 21752f9..5e4ab2e 100644
--- a/test/unpack_test.dart
+++ b/test/unpack_test.dart
@@ -21,15 +21,16 @@
     await runPub(
       args: ['unpack', 'foo:1:2:3'],
       error: contains(
-        'Error on line 1, column 1 of descriptor: Invalid version constraint: Could not parse version "1:2:3". Unknown text at "1:2:3".',
+        'Error on line 1, column 1 of descriptor: Invalid version constraint: '
+        'Could not parse version "1:2:3". Unknown text at "1:2:3".',
       ),
       exitCode: DATA,
     );
 
     await runPub(
       args: ['unpack', 'foo:1.0'],
-      error:
-          'Error on line 1, column 1 of descriptor: A dependency specification must be a string or a mapping.',
+      error: 'Error on line 1, column 1 of descriptor: '
+          'A dependency specification must be a string or a mapping.',
       exitCode: DATA,
     );
 
@@ -38,8 +39,8 @@
     );
     await runPub(
       args: ['unpack', 'foo'],
-      error:
-          'Target directory `.${s}foo-1.2.3` already exists. Use --force to overwrite.',
+      error: 'Target directory `.${s}foo-1.2.3` already exists. '
+          'Use --force to overwrite.',
       exitCode: 1,
     );
     await runPub(args: ['unpack', 'foo', '--force']);
diff --git a/test/upgrade/report/describes_change_test.dart b/test/upgrade/report/describes_change_test.dart
index 0e9a3d6..97c6e5b 100644
--- a/test/upgrade/report/describes_change_test.dart
+++ b/test/upgrade/report/describes_change_test.dart
@@ -99,10 +99,13 @@
       output: allOf([
         contains('Resolving dependencies...'),
         contains(
-          '* description_changed 1.0.0 from path ..${separator}description_changed_2 (was 1.0.0 from path ..${separator}description_changed_1)',
+          '* description_changed 1.0.0 from path '
+          '..${separator}description_changed_2 (was 1.0.0 from path '
+          '..${separator}description_changed_1)',
         ),
         contains(
-          '* source_changed 2.0.0 from path ..${separator}source_changed (was 1.0.0)',
+          '* source_changed 2.0.0 from path '
+          '..${separator}source_changed (was 1.0.0)',
         ),
         contains('> version_upgraded 2.0.0 (was 1.0.0'),
         contains('< version_downgraded 1.0.0 (was 2.0.0'),
diff --git a/test/upgrade/report/does_not_show_newer_versions_for_locked_packages_test.dart b/test/upgrade/report/does_not_show_newer_versions_for_locked_packages_test.dart
index fbb12cb..16b7419 100644
--- a/test/upgrade/report/does_not_show_newer_versions_for_locked_packages_test.dart
+++ b/test/upgrade/report/does_not_show_newer_versions_for_locked_packages_test.dart
@@ -9,8 +9,8 @@
 
 void main() {
   test(
-      'Shows newer versions available for packages that are locked and not being upgraded',
-      () async {
+      'Shows newer versions available for packages that are locked '
+      'and not being upgraded', () async {
     await servePackages()
       ..serve('not_upgraded', '1.0.0')
       ..serve('not_upgraded', '2.0.0')
diff --git a/test/upgrade/upgrade_tighten_test.dart b/test/upgrade/upgrade_tighten_test.dart
index 7f63745..f720bc1 100644
--- a/test/upgrade/upgrade_tighten_test.dart
+++ b/test/upgrade/upgrade_tighten_test.dart
@@ -80,8 +80,8 @@
     });
 
     test(
-        '--major-versions updates dependency constraints lower bounds and shows summary report',
-        () async {
+        '--major-versions updates dependency constraints lower bounds '
+        'and shows summary report', () async {
       final server = await servePackages();
 
       server.serve('foo', '1.0.0');
diff --git a/test/validator/analyze_test.dart b/test/validator/analyze_test.dart
index f215b6f..02addba 100644
--- a/test/validator/analyze_test.dart
+++ b/test/validator/analyze_test.dart
@@ -34,8 +34,8 @@
   });
 
   test(
-      'follows analysis_options.yaml and should not warn if package contains only infos',
-      () async {
+      'follows analysis_options.yaml '
+      'and should not warn if package contains only infos', () async {
     await d.dir(appPath, [
       d.libPubspec(
         'test_pkg', '1.0.0',
@@ -57,8 +57,8 @@
   });
 
   test(
-      'follows analysis_options.yaml and should warn if package contains warnings in pubspec.yaml',
-      () async {
+      'follows analysis_options.yaml and '
+      'should warn if package contains warnings in pubspec.yaml', () async {
     await d.dir(appPath, [
       d.libPubspec(
         'test_pkg', '1.0.0',
@@ -82,7 +82,8 @@
     await expectValidation(
       error: allOf([
         contains(
-          "The 'http' protocol shouldn't be used because it isn't secure. Try using a secure protocol, such as 'https'.",
+          "The 'http' protocol shouldn't be used because it isn't secure. "
+          "Try using a secure protocol, such as 'https'.",
         ),
         contains('Package has 1 warning.'),
       ]),
diff --git a/test/validator/dependency_test.dart b/test/validator/dependency_test.dart
index bfb4c92..858df16 100644
--- a/test/validator/dependency_test.dart
+++ b/test/validator/dependency_test.dart
@@ -138,7 +138,8 @@
     });
 
     test(
-      'depends on a package from Flutter with an appropriate Dart SDK constraint',
+      'depends on a package from Flutter '
+      'with an appropriate Dart SDK constraint',
       () async {
         await d.dir('flutter', [d.flutterVersion('1.2.3')]).create();
         await flutterPackage('foo').create();
@@ -157,7 +158,8 @@
     );
 
     test(
-      'depends on a package from Fuchsia with an appropriate Dart SDK constraint',
+      'depends on a package from Fuchsia '
+      'with an appropriate Dart SDK constraint',
       () async {
         await fuchsiaPackage('foo', sdk: '^3.0.0').create();
         await package(
@@ -194,8 +196,8 @@
         });
 
         test(
-            "and should suggest the hosted prerelease version if it's the only version available",
-            () async {
+            'and should suggest the hosted prerelease version '
+            "if it's the only version available", () async {
           await d.dir('foo', [
             d.libPubspec('foo', '1.2.3'),
           ]).create();
@@ -266,8 +268,8 @@
         });
 
         test(
-            'and it should suggest a concrete constraint if the locked version is pre-1.0.0',
-            () async {
+            'and it should suggest a concrete constraint '
+            'if the locked version is pre-1.0.0', () async {
           (await servePackages()).serve('foo', '0.1.2');
 
           await d.dir(appPath, [
diff --git a/test/validator/flutter_constraint_test.dart b/test/validator/flutter_constraint_test.dart
index f2c14c8..95217f4 100644
--- a/test/validator/flutter_constraint_test.dart
+++ b/test/validator/flutter_constraint_test.dart
@@ -30,8 +30,8 @@
   await d.dir(appPath, [
     d.pubspec({
       'name': 'test_pkg',
-      'description':
-          'A just long enough description to fit the requirement of 60 characters',
+      'description': 'A just long enough description '
+          'to fit the requirement of 60 characters',
       'homepage': 'https://example.com/',
       'version': '1.0.0',
       'environment': {
diff --git a/test/validator/flutter_plugin_format_test.dart b/test/validator/flutter_plugin_format_test.dart
index 5b6fcb4..db537e5 100644
--- a/test/validator/flutter_plugin_format_test.dart
+++ b/test/validator/flutter_plugin_format_test.dart
@@ -158,8 +158,8 @@
     });
 
     test(
-        'is a flutter plugin with only implicit flutter sdk version constraint and the new format',
-        () async {
+        'is a flutter plugin with only implicit flutter sdk version constraint '
+        'and the new format', () async {
       final pkg = packageMap('test_pkg', '1.0.0', {
         'flutter': {'sdk': 'flutter'},
       }, {}, {
diff --git a/test/validator/gitignore_test.dart b/test/validator/gitignore_test.dart
index 08aff35..58c431f 100644
--- a/test/validator/gitignore_test.dart
+++ b/test/validator/gitignore_test.dart
@@ -28,8 +28,8 @@
 
 void main() {
   test(
-      'should consider a package valid if it contains no checked in otherwise ignored files',
-      () async {
+      'should consider a package valid '
+      'if it contains no checked in otherwise ignored files', () async {
     await d.git('myapp', [
       ...d.validPackage().contents,
       d.file('foo.txt'),
@@ -46,7 +46,8 @@
         contains('Package has 1 warning.'),
         contains('foo.txt'),
         contains(
-          'Consider adjusting your `.gitignore` files to not ignore those files',
+          'Consider adjusting your `.gitignore` files '
+          'to not ignore those files',
         ),
       ]),
       exit_codes.DATA,
@@ -115,7 +116,8 @@
         contains('Package has 1 warning.'),
         contains('foo.txt'),
         contains(
-          'Consider adjusting your `.gitignore` files to not ignore those files',
+          'Consider adjusting your `.gitignore` files '
+          'to not ignore those files',
         ),
       ]),
       exit_codes.DATA,
diff --git a/test/validator/language_version_test.dart b/test/validator/language_version_test.dart
index c0c0a21..ed43727 100644
--- a/test/validator/language_version_test.dart
+++ b/test/validator/language_version_test.dart
@@ -71,7 +71,8 @@
         libraryLanguageVersion: nextLanguageVersion,
       );
       await expectValidationWarning(
-        'The language version override can\'t specify a version greater than the latest known language version',
+        'The language version override can\'t specify a version '
+        'greater than the latest known language version',
       );
     });
     test('opts in to a newer version, with non-range constraint.', () async {
@@ -80,7 +81,8 @@
         libraryLanguageVersion: nextLanguageVersion,
       );
       await expectValidationWarning(
-        'The language version override can\'t specify a version greater than the latest known language version',
+        'The language version override can\'t specify a version '
+        'greater than the latest known language version',
       );
     });
   });
diff --git a/test/validator/sdk_constraint_test.dart b/test/validator/sdk_constraint_test.dart
index 1dbe3e8..192cda0 100644
--- a/test/validator/sdk_constraint_test.dart
+++ b/test/validator/sdk_constraint_test.dart
@@ -112,8 +112,8 @@
     });
 
     test(
-        'Gives a hint if package has a <3.0.0 constraint that is interpreted as <4.0.0',
-        () async {
+        'Gives a hint if package has a <3.0.0 constraint '
+        'that is interpreted as <4.0.0', () async {
       await d.dir(appPath, [
         d.rawPubspec({
           'name': 'test_pkg',
diff --git a/test/validator/strict_dependencies_test.dart b/test/validator/strict_dependencies_test.dart
index 075fb1d..155f326 100644
--- a/test/validator/strict_dependencies_test.dart
+++ b/test/validator/strict_dependencies_test.dart
@@ -342,7 +342,8 @@
             strictDeps,
             warnings: [
               matches(
-                'does not have silly_monkey in the `dependencies` or `dev_dependencies` section',
+                'does not have silly_monkey in the '
+                '`dependencies` or `dev_dependencies` section',
               ),
             ],
           );
diff --git a/test/version_solver_test.dart b/test/version_solver_test.dart
index 8aa3e7a..a2bd6a7 100644
--- a/test/version_solver_test.dart
+++ b/test/version_solver_test.dart
@@ -201,8 +201,8 @@
 
   // Issue 1853
   test(
-      "produces a nice message for a locked dependency that's the only version of its package",
-      () async {
+      'produces a nice message for a locked dependency '
+      "that's the only version of its package", () async {
     await servePackages()
       ..serve('foo', '1.0.0', deps: {'bar': '>=2.0.0'})
       ..serve('bar', '1.0.0')
@@ -374,7 +374,8 @@
 
       await expectResolves(
         error: contains(
-          'Because myapp depends on both foo ^1.0.0 and foo ^2.0.0, version solving failed.',
+          'Because myapp depends on both '
+          'foo ^1.0.0 and foo ^2.0.0, version solving failed.',
         ),
       );
     });
@@ -1634,7 +1635,8 @@
     ).create();
     await expectResolves(
       error: contains(
-        'So, because myapp depends on both a 0.12.0 and b any, version solving failed.',
+        'So, because myapp depends on both '
+        'a 0.12.0 and b any, version solving failed.',
       ),
       tries: 2,
     );
diff --git a/test/workspace_test.dart b/test/workspace_test.dart
index 9ea3d09..7bd9db9 100644
--- a/test/workspace_test.dart
+++ b/test/workspace_test.dart
@@ -198,14 +198,15 @@
     await pubGet(
       environment: {'_PUB_TEST_SDK_VERSION': '3.5.0'},
       error: contains(
-        'Because myapp depends on a which depends on myapp ^0.2.3, myapp ^0.2.3 is required',
+        'Because myapp depends on a '
+        'which depends on myapp ^0.2.3, myapp ^0.2.3 is required',
       ),
     );
   });
 
   test(
-      'ignores the source of dependencies on root packages. (Uses the local version instead)',
-      () async {
+      'ignores the source of dependencies on root packages. '
+      '(Uses the local version instead)', () async {
     await dir(appPath, [
       libPubspec(
         'myapp',
@@ -258,7 +259,8 @@
     await pubGet(
       environment: {'_PUB_TEST_SDK_VERSION': '3.5.0'},
       error: contains(
-        'Error on line 1, column 118 of pkgs${s}a${s}pubspec.yaml: A dependency specification must be a string or a mapping.',
+        'Error on line 1, column 118 of pkgs${s}a${s}pubspec.yaml: '
+        'A dependency specification must be a string or a mapping.',
       ),
       exitCode: DATA,
     );
@@ -290,7 +292,8 @@
     await pubGet(
       environment: {'_PUB_TEST_SDK_VERSION': '3.5.0'},
       error: contains(
-        'Because a depends on foo from unknown source "posted", version solving failed.',
+        'Because a depends on foo from unknown source "posted", '
+        'version solving failed.',
       ),
     );
   });
@@ -318,7 +321,8 @@
     await pubGet(
       environment: {'_PUB_TEST_SDK_VERSION': '3.5.0'},
       error: contains(
-        'pkgs${s}a${s}pubspec.yaml is included in the workspace from .${s}pubspec.yaml, but does not have `resolution: workspace`.',
+        'pkgs${s}a${s}pubspec.yaml is included in the workspace from '
+        '.${s}pubspec.yaml, but does not have `resolution: workspace`.',
       ),
     );
   });
@@ -407,12 +411,15 @@
         ),
       ]),
     ]).create();
+    final appABPath = p.join(sandbox, appPath, 'a', 'b');
+    final aPubspecPath = p.join('.', 'a', 'pubspec.yaml');
+    final pubspecPath = p.join('.', 'pubspec.yaml');
     await pubGet(
       environment: {'_PUB_TEST_SDK_VERSION': '3.5.0'},
       error: contains(
-        'Could not find a file named "pubspec.yaml" in "${p.join(sandbox, appPath, 'a', 'b')}".\n'
-        'That was included in the workspace of ${p.join('.', 'a', 'pubspec.yaml')}.\n'
-        'That was included in the workspace of ${p.join('.', 'pubspec.yaml')}.',
+        'Could not find a file named "pubspec.yaml" in "$appABPath".\n'
+        'That was included in the workspace of $aPubspecPath.\n'
+        'That was included in the workspace of $pubspecPath.',
       ),
       exitCode: NO_INPUT,
     );
@@ -790,8 +797,8 @@
   });
 
   test(
-      'Reports a failure if a workspace pubspec is not nested inside the parent dir',
-      () async {
+      'Reports a failure if a workspace pubspec is not nested '
+      'inside the parent dir', () async {
     await dir(appPath, [
       libPubspec(
         'myapp',
@@ -1190,8 +1197,8 @@
     ]).create();
     await pubGet(
       environment: {'_PUB_TEST_SDK_VERSION': '3.5.0'},
-      error:
-          'Because myapp depends on both a 2.0.0 and a, version solving failed.',
+      error: 'Because myapp depends on both a 2.0.0 and a, '
+          'version solving failed.',
     );
   });
 
@@ -1355,8 +1362,8 @@
   });
 
   test(
-      'published packages with `resolution: workspace` and `workspace` sections can be consumed out of context.',
-      () async {
+      'published packages with `resolution: workspace` '
+      'and `workspace` sections can be consumed out of context.', () async {
     final server = await servePackages();
     server.serve(
       'foo',
diff --git a/tool/test.dart b/tool/test.dart
index 4d831a5..fd173b4 100755
--- a/tool/test.dart
+++ b/tool/test.dart
@@ -21,7 +21,8 @@
 Future<void> main(List<String> args) async {
   if (Platform.environment['FLUTTER_ROOT'] != null) {
     stderr.writeln(
-      'WARNING: The tests will not run correctly with dart from a flutter checkout!',
+      'WARNING: '
+      'The tests will not run correctly with dart from a flutter checkout!',
     );
   }
   Process? testProcess;