Skip to content

Commit

Permalink
Move to latest pkg:dart_flutter_team_lints, bump min sdk to Dart 3 (#378
Browse files Browse the repository at this point in the history
)
  • Loading branch information
kevmoo committed Sep 13, 2023
1 parent 2926f76 commit e2a02b7
Show file tree
Hide file tree
Showing 24 changed files with 108 additions and 163 deletions.
151 changes: 47 additions & 104 deletions .github/workflows/dart.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,23 +40,23 @@ jobs:
- name: mono_repo self validate
run: dart pub global run mono_repo generate --validate
job_002:
name: "analyze_and_format; linux; Dart 2.19.0; PKGS: pkgs/shelf, pkgs/shelf_packages_handler, pkgs/shelf_proxy, pkgs/shelf_router, pkgs/shelf_static, pkgs/shelf_test_handler, pkgs/shelf_web_socket; `dart analyze --fatal-infos .`"
name: "analyze_and_format; linux; Dart 3.0.0; PKGS: pkgs/shelf, pkgs/shelf_packages_handler, pkgs/shelf_proxy, pkgs/shelf_router, pkgs/shelf_router_generator, pkgs/shelf_static, pkgs/shelf_test_handler, pkgs/shelf_web_socket; `dart analyze --fatal-infos .`"
runs-on: ubuntu-latest
steps:
- name: Cache Pub hosted dependencies
uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8
with:
path: "~/.pub-cache/hosted"
key: "os:ubuntu-latest;pub-cache-hosted;sdk:2.19.0;packages:pkgs/shelf-pkgs/shelf_packages_handler-pkgs/shelf_proxy-pkgs/shelf_router-pkgs/shelf_static-pkgs/shelf_test_handler-pkgs/shelf_web_socket;commands:analyze"
key: "os:ubuntu-latest;pub-cache-hosted;sdk:3.0.0;packages:pkgs/shelf-pkgs/shelf_packages_handler-pkgs/shelf_proxy-pkgs/shelf_router-pkgs/shelf_router_generator-pkgs/shelf_static-pkgs/shelf_test_handler-pkgs/shelf_web_socket;commands:analyze"
restore-keys: |
os:ubuntu-latest;pub-cache-hosted;sdk:2.19.0;packages:pkgs/shelf-pkgs/shelf_packages_handler-pkgs/shelf_proxy-pkgs/shelf_router-pkgs/shelf_static-pkgs/shelf_test_handler-pkgs/shelf_web_socket
os:ubuntu-latest;pub-cache-hosted;sdk:2.19.0
os:ubuntu-latest;pub-cache-hosted;sdk:3.0.0;packages:pkgs/shelf-pkgs/shelf_packages_handler-pkgs/shelf_proxy-pkgs/shelf_router-pkgs/shelf_router_generator-pkgs/shelf_static-pkgs/shelf_test_handler-pkgs/shelf_web_socket
os:ubuntu-latest;pub-cache-hosted;sdk:3.0.0
os:ubuntu-latest;pub-cache-hosted
os:ubuntu-latest
- name: Setup Dart SDK
uses: dart-lang/setup-dart@d6a63dab3335f427404425de0fbfed4686d93c4f
with:
sdk: "2.19.0"
sdk: "3.0.0"
- id: checkout
name: Checkout repository
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744
Expand Down Expand Up @@ -96,6 +96,15 @@ jobs:
run: dart analyze --fatal-infos .
if: "always() && steps.pkgs_shelf_router_pub_upgrade.conclusion == 'success'"
working-directory: pkgs/shelf_router
- id: pkgs_shelf_router_generator_pub_upgrade
name: pkgs/shelf_router_generator; dart pub upgrade
run: dart pub upgrade
if: "always() && steps.checkout.conclusion == 'success'"
working-directory: pkgs/shelf_router_generator
- name: "pkgs/shelf_router_generator; dart analyze --fatal-infos ."
run: dart analyze --fatal-infos .
if: "always() && steps.pkgs_shelf_router_generator_pub_upgrade.conclusion == 'success'"
working-directory: pkgs/shelf_router_generator
- id: pkgs_shelf_static_pub_upgrade
name: pkgs/shelf_static; dart pub upgrade
run: dart pub upgrade
Expand Down Expand Up @@ -124,36 +133,6 @@ jobs:
if: "always() && steps.pkgs_shelf_web_socket_pub_upgrade.conclusion == 'success'"
working-directory: pkgs/shelf_web_socket
job_003:
name: "analyze_and_format; linux; Dart 3.0.0; PKG: pkgs/shelf_router_generator; `dart analyze --fatal-infos .`"
runs-on: ubuntu-latest
steps:
- name: Cache Pub hosted dependencies
uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8
with:
path: "~/.pub-cache/hosted"
key: "os:ubuntu-latest;pub-cache-hosted;sdk:3.0.0;packages:pkgs/shelf_router_generator;commands:analyze"
restore-keys: |
os:ubuntu-latest;pub-cache-hosted;sdk:3.0.0;packages:pkgs/shelf_router_generator
os:ubuntu-latest;pub-cache-hosted;sdk:3.0.0
os:ubuntu-latest;pub-cache-hosted
os:ubuntu-latest
- name: Setup Dart SDK
uses: dart-lang/setup-dart@d6a63dab3335f427404425de0fbfed4686d93c4f
with:
sdk: "3.0.0"
- id: checkout
name: Checkout repository
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744
- id: pkgs_shelf_router_generator_pub_upgrade
name: pkgs/shelf_router_generator; dart pub upgrade
run: dart pub upgrade
if: "always() && steps.checkout.conclusion == 'success'"
working-directory: pkgs/shelf_router_generator
- name: "pkgs/shelf_router_generator; dart analyze --fatal-infos ."
run: dart analyze --fatal-infos .
if: "always() && steps.pkgs_shelf_router_generator_pub_upgrade.conclusion == 'success'"
working-directory: pkgs/shelf_router_generator
job_004:
name: "analyze_and_format; linux; Dart dev; PKGS: pkgs/shelf, pkgs/shelf_packages_handler, pkgs/shelf_proxy, pkgs/shelf_router, pkgs/shelf_router_generator, pkgs/shelf_static, pkgs/shelf_test_handler, pkgs/shelf_web_socket; `dart analyze --fatal-infos .`"
runs-on: ubuntu-latest
steps:
Expand Down Expand Up @@ -246,7 +225,7 @@ jobs:
run: dart analyze --fatal-infos .
if: "always() && steps.pkgs_shelf_web_socket_pub_upgrade.conclusion == 'success'"
working-directory: pkgs/shelf_web_socket
job_005:
job_004:
name: "analyze_and_format; linux; Dart dev; PKGS: pkgs/shelf, pkgs/shelf_packages_handler, pkgs/shelf_proxy, pkgs/shelf_router, pkgs/shelf_router_generator, pkgs/shelf_static, pkgs/shelf_test_handler, pkgs/shelf_web_socket; `dart format --output=none --set-exit-if-changed .`"
runs-on: ubuntu-latest
steps:
Expand Down Expand Up @@ -339,24 +318,24 @@ jobs:
run: "dart format --output=none --set-exit-if-changed ."
if: "always() && steps.pkgs_shelf_web_socket_pub_upgrade.conclusion == 'success'"
working-directory: pkgs/shelf_web_socket
job_006:
name: "unit_test; linux; Dart 2.19.0; PKGS: pkgs/shelf, pkgs/shelf_test_handler; `dart test --test-randomize-ordering-seed=random -p chrome`"
job_005:
name: "unit_test; linux; Dart 3.0.0; PKGS: pkgs/shelf, pkgs/shelf_test_handler; `dart test --test-randomize-ordering-seed=random -p chrome`"
runs-on: ubuntu-latest
steps:
- name: Cache Pub hosted dependencies
uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8
with:
path: "~/.pub-cache/hosted"
key: "os:ubuntu-latest;pub-cache-hosted;sdk:2.19.0;packages:pkgs/shelf-pkgs/shelf_test_handler;commands:test_1"
key: "os:ubuntu-latest;pub-cache-hosted;sdk:3.0.0;packages:pkgs/shelf-pkgs/shelf_test_handler;commands:test_1"
restore-keys: |
os:ubuntu-latest;pub-cache-hosted;sdk:2.19.0;packages:pkgs/shelf-pkgs/shelf_test_handler
os:ubuntu-latest;pub-cache-hosted;sdk:2.19.0
os:ubuntu-latest;pub-cache-hosted;sdk:3.0.0;packages:pkgs/shelf-pkgs/shelf_test_handler
os:ubuntu-latest;pub-cache-hosted;sdk:3.0.0
os:ubuntu-latest;pub-cache-hosted
os:ubuntu-latest
- name: Setup Dart SDK
uses: dart-lang/setup-dart@d6a63dab3335f427404425de0fbfed4686d93c4f
with:
sdk: "2.19.0"
sdk: "3.0.0"
- id: checkout
name: Checkout repository
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744
Expand All @@ -383,25 +362,24 @@ jobs:
- job_002
- job_003
- job_004
- job_005
job_007:
name: "unit_test; linux; Dart 2.19.0; PKGS: pkgs/shelf, pkgs/shelf_packages_handler, pkgs/shelf_proxy, pkgs/shelf_router, pkgs/shelf_static, pkgs/shelf_test_handler, pkgs/shelf_web_socket; `dart test --test-randomize-ordering-seed=random`"
job_006:
name: "unit_test; linux; Dart 3.0.0; PKGS: pkgs/shelf, pkgs/shelf_packages_handler, pkgs/shelf_proxy, pkgs/shelf_router, pkgs/shelf_router_generator, pkgs/shelf_static, pkgs/shelf_test_handler, pkgs/shelf_web_socket; `dart test --test-randomize-ordering-seed=random`"
runs-on: ubuntu-latest
steps:
- name: Cache Pub hosted dependencies
uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8
with:
path: "~/.pub-cache/hosted"
key: "os:ubuntu-latest;pub-cache-hosted;sdk:2.19.0;packages:pkgs/shelf-pkgs/shelf_packages_handler-pkgs/shelf_proxy-pkgs/shelf_router-pkgs/shelf_static-pkgs/shelf_test_handler-pkgs/shelf_web_socket;commands:test_0"
key: "os:ubuntu-latest;pub-cache-hosted;sdk:3.0.0;packages:pkgs/shelf-pkgs/shelf_packages_handler-pkgs/shelf_proxy-pkgs/shelf_router-pkgs/shelf_router_generator-pkgs/shelf_static-pkgs/shelf_test_handler-pkgs/shelf_web_socket;commands:test_0"
restore-keys: |
os:ubuntu-latest;pub-cache-hosted;sdk:2.19.0;packages:pkgs/shelf-pkgs/shelf_packages_handler-pkgs/shelf_proxy-pkgs/shelf_router-pkgs/shelf_static-pkgs/shelf_test_handler-pkgs/shelf_web_socket
os:ubuntu-latest;pub-cache-hosted;sdk:2.19.0
os:ubuntu-latest;pub-cache-hosted;sdk:3.0.0;packages:pkgs/shelf-pkgs/shelf_packages_handler-pkgs/shelf_proxy-pkgs/shelf_router-pkgs/shelf_router_generator-pkgs/shelf_static-pkgs/shelf_test_handler-pkgs/shelf_web_socket
os:ubuntu-latest;pub-cache-hosted;sdk:3.0.0
os:ubuntu-latest;pub-cache-hosted
os:ubuntu-latest
- name: Setup Dart SDK
uses: dart-lang/setup-dart@d6a63dab3335f427404425de0fbfed4686d93c4f
with:
sdk: "2.19.0"
sdk: "3.0.0"
- id: checkout
name: Checkout repository
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744
Expand Down Expand Up @@ -441,6 +419,15 @@ jobs:
run: "dart test --test-randomize-ordering-seed=random"
if: "always() && steps.pkgs_shelf_router_pub_upgrade.conclusion == 'success'"
working-directory: pkgs/shelf_router
- id: pkgs_shelf_router_generator_pub_upgrade
name: pkgs/shelf_router_generator; dart pub upgrade
run: dart pub upgrade
if: "always() && steps.checkout.conclusion == 'success'"
working-directory: pkgs/shelf_router_generator
- name: "pkgs/shelf_router_generator; dart test --test-randomize-ordering-seed=random"
run: "dart test --test-randomize-ordering-seed=random"
if: "always() && steps.pkgs_shelf_router_generator_pub_upgrade.conclusion == 'success'"
working-directory: pkgs/shelf_router_generator
- id: pkgs_shelf_static_pub_upgrade
name: pkgs/shelf_static; dart pub upgrade
run: dart pub upgrade
Expand Down Expand Up @@ -473,44 +460,7 @@ jobs:
- job_002
- job_003
- job_004
- job_005
job_008:
name: "unit_test; linux; Dart 3.0.0; PKG: pkgs/shelf_router_generator; `dart test --test-randomize-ordering-seed=random`"
runs-on: ubuntu-latest
steps:
- name: Cache Pub hosted dependencies
uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8
with:
path: "~/.pub-cache/hosted"
key: "os:ubuntu-latest;pub-cache-hosted;sdk:3.0.0;packages:pkgs/shelf_router_generator;commands:test_0"
restore-keys: |
os:ubuntu-latest;pub-cache-hosted;sdk:3.0.0;packages:pkgs/shelf_router_generator
os:ubuntu-latest;pub-cache-hosted;sdk:3.0.0
os:ubuntu-latest;pub-cache-hosted
os:ubuntu-latest
- name: Setup Dart SDK
uses: dart-lang/setup-dart@d6a63dab3335f427404425de0fbfed4686d93c4f
with:
sdk: "3.0.0"
- id: checkout
name: Checkout repository
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744
- id: pkgs_shelf_router_generator_pub_upgrade
name: pkgs/shelf_router_generator; dart pub upgrade
run: dart pub upgrade
if: "always() && steps.checkout.conclusion == 'success'"
working-directory: pkgs/shelf_router_generator
- name: "pkgs/shelf_router_generator; dart test --test-randomize-ordering-seed=random"
run: "dart test --test-randomize-ordering-seed=random"
if: "always() && steps.pkgs_shelf_router_generator_pub_upgrade.conclusion == 'success'"
working-directory: pkgs/shelf_router_generator
needs:
- job_001
- job_002
- job_003
- job_004
- job_005
job_009:
job_007:
name: "unit_test; linux; Dart dev; PKGS: pkgs/shelf, pkgs/shelf_test_handler; `dart test --test-randomize-ordering-seed=random -p chrome`"
runs-on: ubuntu-latest
steps:
Expand Down Expand Up @@ -554,8 +504,7 @@ jobs:
- job_002
- job_003
- job_004
- job_005
job_010:
job_008:
name: "unit_test; linux; Dart dev; PKGS: pkgs/shelf, pkgs/shelf_packages_handler, pkgs/shelf_proxy, pkgs/shelf_router, pkgs/shelf_router_generator, pkgs/shelf_static, pkgs/shelf_test_handler, pkgs/shelf_web_socket; `dart test --test-randomize-ordering-seed=random`"
runs-on: ubuntu-latest
steps:
Expand Down Expand Up @@ -653,8 +602,7 @@ jobs:
- job_002
- job_003
- job_004
- job_005
job_011:
job_009:
name: "unit_test; linux; Dart dev; PKG: pkgs/shelf_router_generator; `dart test --run-skipped -t presubmit-only`"
runs-on: ubuntu-latest
steps:
Expand Down Expand Up @@ -689,15 +637,14 @@ jobs:
- job_002
- job_003
- job_004
- job_005
job_012:
name: "unit_test; windows; Dart 2.19.0; PKGS: pkgs/shelf, pkgs/shelf_test_handler; `dart test --test-randomize-ordering-seed=random -p chrome`"
job_010:
name: "unit_test; windows; Dart 3.0.0; PKGS: pkgs/shelf, pkgs/shelf_test_handler; `dart test --test-randomize-ordering-seed=random -p chrome`"
runs-on: windows-latest
steps:
- name: Setup Dart SDK
uses: dart-lang/setup-dart@d6a63dab3335f427404425de0fbfed4686d93c4f
with:
sdk: "2.19.0"
sdk: "3.0.0"
- id: checkout
name: Checkout repository
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744
Expand All @@ -724,15 +671,14 @@ jobs:
- job_002
- job_003
- job_004
- job_005
job_013:
name: "unit_test; windows; Dart 2.19.0; PKGS: pkgs/shelf_packages_handler, pkgs/shelf_static, pkgs/shelf_test_handler, pkgs/shelf_web_socket; `dart test --test-randomize-ordering-seed=random`"
job_011:
name: "unit_test; windows; Dart 3.0.0; PKGS: pkgs/shelf_packages_handler, pkgs/shelf_static, pkgs/shelf_test_handler, pkgs/shelf_web_socket; `dart test --test-randomize-ordering-seed=random`"
runs-on: windows-latest
steps:
- name: Setup Dart SDK
uses: dart-lang/setup-dart@d6a63dab3335f427404425de0fbfed4686d93c4f
with:
sdk: "2.19.0"
sdk: "3.0.0"
- id: checkout
name: Checkout repository
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744
Expand Down Expand Up @@ -777,8 +723,7 @@ jobs:
- job_002
- job_003
- job_004
- job_005
job_014:
job_012:
name: "unit_test; windows; Dart dev; PKGS: pkgs/shelf, pkgs/shelf_test_handler; `dart test --test-randomize-ordering-seed=random -p chrome`"
runs-on: windows-latest
steps:
Expand Down Expand Up @@ -812,8 +757,7 @@ jobs:
- job_002
- job_003
- job_004
- job_005
job_015:
job_013:
name: "unit_test; windows; Dart dev; PKGS: pkgs/shelf_packages_handler, pkgs/shelf_static, pkgs/shelf_test_handler, pkgs/shelf_web_socket; `dart test --test-randomize-ordering-seed=random`"
runs-on: windows-latest
steps:
Expand Down Expand Up @@ -865,4 +809,3 @@ jobs:
- job_002
- job_003
- job_004
- job_005
5 changes: 2 additions & 3 deletions analysis_options.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ analyzer:
strict-casts: true
strict-inference: true
strict-raw-types: true
errors:
comment_references: ignore # too many false positives

linter:
rules:
Expand All @@ -16,7 +18,4 @@ linter:
- no_adjacent_strings_in_list
- no_runtimeType_toString
- package_api_docs
- prefer_relative_imports
- test_types_in_equals
- unnecessary_await_in_return
- use_super_parameters
2 changes: 1 addition & 1 deletion pkgs/shelf/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
## 1.4.2-dev

* Require Dart >= 2.19
* Require Dart ^3.0.0

## 1.4.1

Expand Down
4 changes: 2 additions & 2 deletions pkgs/shelf/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ topics:
- shelf

environment:
sdk: '>=2.19.0 <3.0.0'
sdk: ^3.0.0

dependencies:
async: ^2.5.0
Expand All @@ -20,6 +20,6 @@ dependencies:
stream_channel: ^2.1.0

dev_dependencies:
dart_flutter_team_lints: ^1.0.0
dart_flutter_team_lints: ^2.0.0
http: '>=0.13.0 <2.0.0'
test: ^1.16.0
20 changes: 10 additions & 10 deletions pkgs/shelf/test/add_chunked_encoding_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -30,36 +30,36 @@ void main() {
});

test("doesn't add chunked encoding with status 1xx", () async {
var response =
await _chunkResponse(Response(123, body: Stream<List<int>>.empty()));
var response = await _chunkResponse(
Response(123, body: const Stream<List<int>>.empty()));
expect(response.headers, isNot(contains('transfer-encoding')));
expect(response.read().toList(), completion(isEmpty));
});

test("doesn't add chunked encoding with status 204", () async {
var response =
await _chunkResponse(Response(204, body: Stream<List<int>>.empty()));
var response = await _chunkResponse(
Response(204, body: const Stream<List<int>>.empty()));
expect(response.headers, isNot(contains('transfer-encoding')));
expect(response.read().toList(), completion(isEmpty));
});

test("doesn't add chunked encoding with status 304", () async {
var response =
await _chunkResponse(Response(204, body: Stream<List<int>>.empty()));
var response = await _chunkResponse(
Response(204, body: const Stream<List<int>>.empty()));
expect(response.headers, isNot(contains('transfer-encoding')));
expect(response.read().toList(), completion(isEmpty));
});

test("doesn't add chunked encoding with status 204", () async {
var response =
await _chunkResponse(Response(204, body: Stream<List<int>>.empty()));
var response = await _chunkResponse(
Response(204, body: const Stream<List<int>>.empty()));
expect(response.headers, isNot(contains('transfer-encoding')));
expect(response.read().toList(), completion(isEmpty));
});

test("doesn't add chunked encoding with status 204", () async {
var response =
await _chunkResponse(Response(204, body: Stream<List<int>>.empty()));
var response = await _chunkResponse(
Response(204, body: const Stream<List<int>>.empty()));
expect(response.headers, isNot(contains('transfer-encoding')));
expect(response.read().toList(), completion(isEmpty));
});
Expand Down
Loading

0 comments on commit e2a02b7

Please sign in to comment.