Skip to content

Commit

Permalink
Update to use and analyze with 3.5 language version (#8041)
Browse files Browse the repository at this point in the history
* Update to 3.5 language version

* Revert runtime SDK change
  • Loading branch information
parlough authored Sep 12, 2024
1 parent 94a74a3 commit 8d438cb
Show file tree
Hide file tree
Showing 35 changed files with 43 additions and 46 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/dart.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Created with package:mono_repo v6.6.1
# Created with package:mono_repo v6.6.2
name: Dart CI
on:
push:
Expand Down Expand Up @@ -36,7 +36,7 @@ jobs:
name: Checkout repository
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c
- name: mono_repo self validate
run: dart pub global activate mono_repo 6.6.1
run: dart pub global activate mono_repo 6.6.2
- name: mono_repo self validate
run: dart pub global run mono_repo generate --validate
job_002:
Expand Down
2 changes: 0 additions & 2 deletions analysis_options.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ analyzer:
linter:
rules:
- always_declare_return_types
- always_require_non_null_named_parameters
- annotate_overrides
- avoid_empty_else
- avoid_init_to_null
Expand Down Expand Up @@ -50,7 +49,6 @@ linter:
- prefer_collection_literals
- prefer_conditional_assignment
- prefer_contains
- prefer_equal_for_default_values
- prefer_final_fields
- prefer_final_locals
- prefer_for_elements_to_map_fromIterable
Expand Down
2 changes: 1 addition & 1 deletion app/lib/fake/backend/fake_email_sender.dart
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class FakeEmailSender implements EmailSender {
sentMessages.add(message);
if (_outputDir != null) {
final uuid = message.localMessageId ?? Ulid().toCanonical();
final file = File(p.join(_outputDir!, '$uuid.json'));
final file = File(p.join(_outputDir, '$uuid.json'));
await file.parent.create(recursive: true);
await file.writeAsString(json.encode(message.toJson()));
}
Expand Down
13 changes: 6 additions & 7 deletions app/lib/frontend/dom/dom.dart
Original file line number Diff line number Diff line change
Expand Up @@ -1036,19 +1036,18 @@ class _StringElement extends _StringNode {
final Map<String, String>? _attributes;
final Object? _children;

_StringElement(this._tag, this._attributes, this._children) {
assert(_children == null ||
_children is _StringNode ||
(_children is Iterable<Node> &&
(_children as Iterable<Node>).every((c) => c is _StringNode)));
}
_StringElement(this._tag, this._attributes, this._children)
: assert(_children == null ||
_children is _StringNode ||
(_children is Iterable<Node> &&
(_children).every((c) => c is _StringNode)));

@override
void writeHtml(StringSink sink) {
sink.write('<');
sink.write(_tag);
if (_attributes != null) {
for (final e in _attributes!.entries) {
for (final e in _attributes.entries) {
sink.write(' ');
sink.write(e.key);
sink.write('="');
Expand Down
6 changes: 3 additions & 3 deletions app/lib/package/model_properties.dart
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ class Pubspec {
return (minDartVersion != null &&
minDartVersion.value.compareTo(dartSdkVersion) > 0) ||
(_minFlutterSdkVersion != null &&
_minFlutterSdkVersion!.value.compareTo(flutterSdkVersion) > 0);
_minFlutterSdkVersion.value.compareTo(flutterSdkVersion) > 0);
}

/// True if either the Dart or the Flutter SDK constraint is higher than the
Expand All @@ -144,8 +144,8 @@ class Pubspec {
late final _dartSdkConstraint = _inner.environment?['sdk'];
late final _flutterSdkConstraint = _inner.environment?['flutter'];
late final _hasDartSdkConstraint = _dartSdkConstraint != null &&
!_dartSdkConstraint!.isAny &&
!_dartSdkConstraint!.isEmpty;
!_dartSdkConstraint.isAny &&
!_dartSdkConstraint.isEmpty;

SdkConstraintStatus get _sdkConstraintStatus =>
SdkConstraintStatus.fromSdkVersion(_dartSdkConstraint, name);
Expand Down
4 changes: 2 additions & 2 deletions app/lib/package/name_tracker.dart
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ class NameTracker {
await for (final p in _db!.query<Package>().run()) {
data.add(TrackedPackage.fromPackage(p));
}
await for (final p in _db!.query<ModeratedPackage>().run()) {
await for (final p in _db.query<ModeratedPackage>().run()) {
data.addModeratedName(p.name!);
}
_data = data;
Expand All @@ -185,7 +185,7 @@ class NameTracker {
_data.add(TrackedPackage.fromPackage(p));
}

final moderatedPkgQuery = _db!.query<ModeratedPackage>()
final moderatedPkgQuery = _db.query<ModeratedPackage>()
..order('moderated')
..filter('moderated >', ts);

Expand Down
2 changes: 1 addition & 1 deletion app/lib/tool/utils/http.dart
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ class _AuthenticatedClient extends http.BaseClient {
}
final currentCookies = request.headers['cookie'];
final providedCookies =
_cookieProvider == null ? null : await _cookieProvider!();
_cookieProvider == null ? null : await _cookieProvider();

final sessionId = await _sessionIdProvider();
request.headers['cookie'] = [
Expand Down
2 changes: 1 addition & 1 deletion app/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -937,4 +937,4 @@ packages:
source: hosted
version: "2.2.1"
sdks:
dart: ">=3.5.0-259.0.dev <4.0.0"
dart: ">=3.5.0 <4.0.0"
2 changes: 1 addition & 1 deletion app/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: pub_dev
description: The pub.dartlang.org website.
environment:
sdk: '^3.0.0'
sdk: ^3.5.0
dependencies:
_popularity:
path: ../pkg/_popularity
Expand Down
2 changes: 1 addition & 1 deletion pkg/_popularity/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -559,4 +559,4 @@ packages:
source: hosted
version: "3.1.2"
sdks:
dart: ">=3.5.0-259.0.dev <4.0.0"
dart: ">=3.5.0 <4.0.0"
2 changes: 1 addition & 1 deletion pkg/_popularity/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: _popularity
publish_to: none

environment:
sdk: '^3.0.0'
sdk: ^3.5.0

dependencies:
json_annotation: ^4.6.0
Expand Down
2 changes: 1 addition & 1 deletion pkg/_pub_shared/lib/utils/flutter_archive.dart
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ class FlutterRelease {
return null;
}
try {
return Version.parse(_extractedDartSdkVersion!);
return Version.parse(_extractedDartSdkVersion);
} catch (_) {
return null;
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/_pub_shared/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -638,4 +638,4 @@ packages:
source: hosted
version: "3.1.2"
sdks:
dart: ">=3.5.0-259.0.dev <4.0.0"
dart: ">=3.5.0 <4.0.0"
2 changes: 1 addition & 1 deletion pkg/_pub_shared/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: _pub_shared
description: Shared data between the pub server and web_app client.
publish_to: none
environment:
sdk: '^3.0.0'
sdk: ^3.5.0

dependencies:
clock: ^1.1.0
Expand Down
2 changes: 1 addition & 1 deletion pkg/api_builder/lib/_client_utils.dart
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class Client {

Future<T> _withClient<T>(FutureOr<T> Function(http.Client) fn) async {
if (_client != null) {
return fn(_client!);
return fn(_client);
}
final client = http.Client();
try {
Expand Down
2 changes: 1 addition & 1 deletion pkg/api_builder/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -583,4 +583,4 @@ packages:
source: hosted
version: "3.1.2"
sdks:
dart: ">=3.5.0-259.0.dev <4.0.0"
dart: ">=3.5.0 <4.0.0"
2 changes: 1 addition & 1 deletion pkg/api_builder/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ description: Builder for generating API routers.
publish_to: none

environment:
sdk: '^3.0.0'
sdk: ^3.5.0

dependencies:
build: ^2.0.0
Expand Down
2 changes: 1 addition & 1 deletion pkg/code_coverage/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -378,4 +378,4 @@ packages:
source: hosted
version: "3.1.1"
sdks:
dart: ">=3.0.0 <4.0.0"
dart: ">=3.5.0 <4.0.0"
2 changes: 1 addition & 1 deletion pkg/code_coverage/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: code_coverage
publish_to: none # don't publish yet
description: Code coverage tools.
environment:
sdk: '^3.0.0'
sdk: ^3.5.0

dependencies:
args: ^2.0.0
Expand Down
2 changes: 1 addition & 1 deletion pkg/fake_gcloud/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -431,4 +431,4 @@ packages:
source: hosted
version: "3.1.2"
sdks:
dart: ">=3.4.0 <4.0.0"
dart: ">=3.5.0 <4.0.0"
2 changes: 1 addition & 1 deletion pkg/fake_gcloud/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ publish_to: none # don't publish yet
description: Fake, in-memory implementation of `package:gcloud` interfaces.

environment:
sdk: '^3.0.0'
sdk: ^3.5.0

dependencies:
gcloud: '^0.8.10'
Expand Down
2 changes: 1 addition & 1 deletion pkg/indexed_blob/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -399,4 +399,4 @@ packages:
source: hosted
version: "3.1.2"
sdks:
dart: ">=3.4.0 <4.0.0"
dart: ">=3.5.0 <4.0.0"
2 changes: 1 addition & 1 deletion pkg/indexed_blob/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: indexed_blob
publish_to: none
environment:
sdk: '^3.0.0'
sdk: ^3.5.0
dependencies:
async: ^2.8.0
jsontool: ^1.1.0
Expand Down
2 changes: 1 addition & 1 deletion pkg/pub_integration/lib/src/test_browser.dart
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ class TestBrowser {

_printCoverage();
if (_coverageDir != null) {
await _saveCoverage(p.join(_coverageDir!, 'puppeteer'));
await _saveCoverage(p.join(_coverageDir, 'puppeteer'));
}
await _tempDir.delete(recursive: true);
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/pub_integration/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -597,4 +597,4 @@ packages:
source: hosted
version: "3.1.2"
sdks:
dart: ">=3.4.0 <4.0.0"
dart: ">=3.5.0 <4.0.0"
2 changes: 1 addition & 1 deletion pkg/pub_integration/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ publish_to: none # don't publish yet
description: Tools for integration tests.

environment:
sdk: '^3.0.0'
sdk: ^3.5.0

dependencies:
_pub_shared:
Expand Down
2 changes: 1 addition & 1 deletion pkg/pub_package_reader/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -447,4 +447,4 @@ packages:
source: hosted
version: "2.2.1"
sdks:
dart: ">=3.4.0 <4.0.0"
dart: ">=3.5.0 <4.0.0"
2 changes: 1 addition & 1 deletion pkg/pub_package_reader/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ description: Scans the package archive, extracts its main content and checks for
publish_to: none

environment:
sdk: '^3.0.0'
sdk: ^3.5.0

dependencies:
clock: ^1.1.0
Expand Down
2 changes: 1 addition & 1 deletion pkg/pub_worker/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -796,4 +796,4 @@ packages:
source: hosted
version: "3.1.2"
sdks:
dart: ">=3.5.0-259.0.dev <4.0.0"
dart: ">=3.5.0 <4.0.0"
2 changes: 1 addition & 1 deletion pkg/pub_worker/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ description: Worker for pana and dartdoc analysis for pub.dev
publish_to: none

environment:
sdk: '^3.0.0'
sdk: ^3.5.0

dependencies:
appengine: ^0.13.6
Expand Down
2 changes: 1 addition & 1 deletion pkg/web_app/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -581,4 +581,4 @@ packages:
source: hosted
version: "3.1.2"
sdks:
dart: ">=3.4.0 <4.0.0"
dart: ">=3.5.0 <4.0.0"
2 changes: 1 addition & 1 deletion pkg/web_app/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: web_app
publish_to: none

environment:
sdk: '^3.4.0'
sdk: ^3.5.0

dependencies:
_pub_shared:
Expand Down
2 changes: 1 addition & 1 deletion pkg/web_css/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -575,4 +575,4 @@ packages:
source: hosted
version: "3.1.2"
sdks:
dart: ">=3.4.0 <4.0.0"
dart: ">=3.5.0 <4.0.0"
2 changes: 1 addition & 1 deletion pkg/web_css/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: web_css
publish_to: none

environment:
sdk: '^3.0.0'
sdk: ^3.5.0

dependencies:
sass: ^1.32.8
Expand Down
2 changes: 1 addition & 1 deletion tool/ci.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/bash
# Created with package:mono_repo v6.6.1
# Created with package:mono_repo v6.6.2

# Support built in commands on windows out of the box.

Expand Down

0 comments on commit 8d438cb

Please sign in to comment.