[tool] Update to Dart 3 (#6030)

Updates the repo tooling to Dart 3, now that the N-2 version has Dart 3, which allows us to use Dart 3 features (e.g., records) going forward.

To allow the update:
- Removes `break` commands from `switch`es (all done automatically with `dart fix --apply`)
- Replaces mocking of `ProcessResult` with just creating an actual `ProcessResult` since it's a `final` data class and thus can't (but also doesn't need to be) mocked.
This commit is contained in:
stuartmorgan
2024-02-06 11:31:48 -08:00
committed by GitHub
parent 9382257ce7
commit 7403992f15
15 changed files with 70 additions and 99 deletions

View File

@ -210,20 +210,16 @@ class VersionCheckCommand extends PackageLoopingCommand {
switch (versionState) {
case _CurrentVersionState.unchanged:
versionChanged = false;
break;
case _CurrentVersionState.validIncrease:
case _CurrentVersionState.validRevert:
case _CurrentVersionState.newPackage:
versionChanged = true;
break;
case _CurrentVersionState.invalidChange:
versionChanged = true;
errors.add('Disallowed version change.');
break;
case _CurrentVersionState.unknown:
versionChanged = false;
errors.add('Unable to determine previous version.');
break;
}
if (!(await _validateChangelogVersion(package,