Skip to content

Commit

Permalink
removed removed operator and right operand
Browse files Browse the repository at this point in the history
  • Loading branch information
jesswrd committed Dec 21, 2024
1 parent cbd5cb8 commit e30495e
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 15 deletions.
4 changes: 2 additions & 2 deletions script/tool/lib/src/common/package_looping_command.dart
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,7 @@ abstract class PackageLoopingCommand extends PackageCommand {
if (minFlutterVersion != null) {
final Pubspec pubspec = package.parsePubspec();
final VersionConstraint? flutterConstraint =
pubspec.environment?['flutter'];
pubspec.environment['flutter'];
if (flutterConstraint != null &&
!flutterConstraint.allows(minFlutterVersion)) {
return PackageResult.skip(
Expand All @@ -350,7 +350,7 @@ abstract class PackageLoopingCommand extends PackageCommand {

if (minDartVersion != null) {
final Pubspec pubspec = package.parsePubspec();
final VersionConstraint? dartConstraint = pubspec.environment?['sdk'];
final VersionConstraint? dartConstraint = pubspec.environment['sdk'];
if (dartConstraint != null && !dartConstraint.allows(minDartVersion)) {
return PackageResult.skip('Does not support Dart $minDartVersion');
}
Expand Down
4 changes: 2 additions & 2 deletions script/tool/lib/src/create_all_packages_app_command.dart
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ dependencies {}
final Pubspec originalPubspec = app.parsePubspec();
const String dartSdkKey = 'sdk';
final VersionConstraint dartSdkConstraint =
originalPubspec.environment?[dartSdkKey] ??
originalPubspec.environment[dartSdkKey] ??
VersionConstraint.compatibleWith(
Version.parse('3.0.0'),
);
Expand Down Expand Up @@ -342,7 +342,7 @@ publish_to: none
version: ${pubspec.version}
environment:${_pubspecMapString(pubspec.environment!)}
environment:${_pubspecMapString(pubspec.environment)}
dependencies:${_pubspecMapString(pubspec.dependencies)}
Expand Down
4 changes: 2 additions & 2 deletions script/tool/lib/src/pubspec_check_command.dart
Original file line number Diff line number Diff line change
Expand Up @@ -488,9 +488,9 @@ class PubspecCheckCommand extends PackageLoopingCommand {
}

final Version? dartConstraintMin =
_minimumForConstraint(pubspec.environment?['sdk']);
_minimumForConstraint(pubspec.environment['sdk']);
final Version? flutterConstraintMin =
_minimumForConstraint(pubspec.environment?['flutter']);
_minimumForConstraint(pubspec.environment['flutter']);

// Validate the Flutter constraint, if any.
if (flutterConstraintMin != null && minMinFlutterVersion != null) {
Expand Down
2 changes: 1 addition & 1 deletion script/tool/lib/src/update_min_sdk_command.dart
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ class UpdateMinSdkCommand extends PackageLoopingCommand {
/// Returns the given "environment" section's [key] constraint as a range,
/// if the key is present and has a range.
VersionRange? _sdkRange(Pubspec pubspec, String key) {
final VersionConstraint? constraint = pubspec.environment?[key];
final VersionConstraint? constraint = pubspec.environment[key];
if (constraint is VersionRange) {
return constraint;
}
Expand Down
2 changes: 1 addition & 1 deletion script/tool/test/create_all_packages_app_command_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,7 @@ android {
final Pubspec generatedPubspec = command.app.parsePubspec();

const String dartSdkKey = 'sdk';
expect(generatedPubspec.environment?[dartSdkKey].toString(),
expect(generatedPubspec.environment[dartSdkKey].toString(),
existingSdkConstraint);
});

Expand Down
14 changes: 7 additions & 7 deletions script/tool/test/update_min_sdk_command_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ void main() {
]);

final String dartVersion =
package.parsePubspec().environment?['sdk'].toString() ?? '';
package.parsePubspec().environment['sdk'].toString();
expect(dartVersion, '^3.1.0');
});

Expand All @@ -65,7 +65,7 @@ void main() {
]);

final String dartVersion =
package.parsePubspec().environment?['sdk'].toString() ?? '';
package.parsePubspec().environment['sdk'].toString();
expect(dartVersion, '^3.1.0');
});

Expand All @@ -80,7 +80,7 @@ void main() {
]);

final String dartVersion =
package.parsePubspec().environment?['sdk'].toString() ?? '';
package.parsePubspec().environment['sdk'].toString();
expect(dartVersion, '^3.2.0');
});

Expand All @@ -98,9 +98,9 @@ void main() {
]);

final String dartVersion =
package.parsePubspec().environment?['sdk'].toString() ?? '';
package.parsePubspec().environment['sdk'].toString();
final String flutterVersion =
package.parsePubspec().environment?['flutter'].toString() ?? '';
package.parsePubspec().environment['flutter'].toString();
expect(dartVersion, '^3.1.0');
expect(flutterVersion, '>=3.13.0');
});
Expand All @@ -119,9 +119,9 @@ void main() {
]);

final String dartVersion =
package.parsePubspec().environment?['sdk'].toString() ?? '';
package.parsePubspec().environment['sdk'].toString();
final String flutterVersion =
package.parsePubspec().environment?['flutter'].toString() ?? '';
package.parsePubspec().environment['flutter'].toString();
expect(dartVersion, '^3.2.0');
expect(flutterVersion, '>=3.16.0');
});
Expand Down

0 comments on commit e30495e

Please sign in to comment.