Remove unnecessary null checks in ‘dev/conductor’ (#118843)

* Remove unnecessary null checks in dev/conductor

* review
This commit is contained in:
Michael Goderbauer 2023-01-19 20:04:08 -08:00 committed by GitHub
parent 9acf34d0d9
commit ec51d3271e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 2 additions and 7 deletions

View File

@ -126,7 +126,7 @@ List<String> getValuesFromEnvOrArgs(
if (env[envName] != null && env[envName] != '') {
return env[envName]!.split(',');
}
final List<String> argValues = argResults[name] as List<String>;
final List<String>? argValues = argResults[name] as List<String>?;
if (argValues != null) {
return argValues;
}

View File

@ -28,7 +28,6 @@ class Remote {
required RemoteName name,
required this.url,
}) : _name = name,
assert(url != null),
assert(url != '');
factory Remote.mirror(String url) {
@ -241,7 +240,6 @@ abstract class Repository {
/// The URL of the remote named [remoteName].
Future<String> remoteUrl(String remoteName) async {
assert(remoteName != null);
return git.getOutput(
<String>['remote', 'get-url', remoteName],
'verify the URL of the $remoteName remote',

View File

@ -86,8 +86,7 @@ String presentState(pb.ConductorState state) {
} else {
buffer.writeln('0 Engine cherrypicks.');
}
if (state.engine.dartRevision != null &&
state.engine.dartRevision.isNotEmpty) {
if (state.engine.dartRevision.isNotEmpty) {
buffer.writeln('New Dart SDK revision: ${state.engine.dartRevision}');
}
buffer.writeln('Framework Repo');
@ -271,7 +270,6 @@ String githubAccount(String remoteUrl) {
/// Will throw a [ConductorException] if [ReleasePhase.RELEASE_COMPLETED] is
/// passed as an argument, as there is no next phase.
ReleasePhase getNextPhase(ReleasePhase currentPhase) {
assert(currentPhase != null);
final ReleasePhase? nextPhase = ReleasePhase.valueOf(currentPhase.value + 1);
if (nextPhase == null) {
throw globals.ConductorException('There is no next ReleasePhase!');

View File

@ -77,7 +77,6 @@ class Version {
/// `flutter --version` and match one of `stablePattern`, `developmentPattern`
/// and `latestPattern`.
factory Version.fromString(String versionString) {
assert(versionString != null);
versionString = versionString.trim();
// stable tag