From 960e8414140ee94d75dffe395a630e077eae15d3 Mon Sep 17 00:00:00 2001 From: Devon Carew Date: Mon, 29 Apr 2024 11:34:41 -0700 Subject: [PATCH 1/4] add 'unnecessary_library_name' to package:dart_flutter_team_lints --- .github/workflows/dart.yml | 4 ++-- pkgs/dart_flutter_team_lints/CHANGELOG.md | 4 +++- .../lib/analysis_options.yaml | 1 + pkgs/dart_flutter_team_lints/pubspec.yaml | 2 +- tool/ci.sh | 18 +++++++----------- 5 files changed, 14 insertions(+), 15 deletions(-) diff --git a/.github/workflows/dart.yml b/.github/workflows/dart.yml index 361b647d..a79686cd 100644 --- a/.github/workflows/dart.yml +++ b/.github/workflows/dart.yml @@ -1,4 +1,4 @@ -# Created with package:mono_repo v6.6.0 +# Created with package:mono_repo v6.6.1 name: Dart CI on: push: @@ -35,7 +35,7 @@ jobs: name: Checkout repository uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 - name: mono_repo self validate - run: dart pub global activate mono_repo 6.6.0 + run: dart pub global activate mono_repo 6.6.1 - name: mono_repo self validate run: dart pub global run mono_repo generate --validate job_002: diff --git a/pkgs/dart_flutter_team_lints/CHANGELOG.md b/pkgs/dart_flutter_team_lints/CHANGELOG.md index 1eafe6c3..34e0311f 100644 --- a/pkgs/dart_flutter_team_lints/CHANGELOG.md +++ b/pkgs/dart_flutter_team_lints/CHANGELOG.md @@ -1,4 +1,6 @@ -## 2.1.2-wip +## 2.2.0 + +- Added `unnecessary_library_name`. ## 2.1.1 diff --git a/pkgs/dart_flutter_team_lints/lib/analysis_options.yaml b/pkgs/dart_flutter_team_lints/lib/analysis_options.yaml index 75dfb966..d8f8ff9e 100644 --- a/pkgs/dart_flutter_team_lints/lib/analysis_options.yaml +++ b/pkgs/dart_flutter_team_lints/lib/analysis_options.yaml @@ -35,6 +35,7 @@ linter: - sort_pub_dependencies - unnecessary_lambdas - unnecessary_library_directive + - unnecessary_library_name - unnecessary_parenthesis - unnecessary_statements - use_is_even_rather_than_modulo diff --git a/pkgs/dart_flutter_team_lints/pubspec.yaml b/pkgs/dart_flutter_team_lints/pubspec.yaml index 6f1ef9f8..aa849f3f 100644 --- a/pkgs/dart_flutter_team_lints/pubspec.yaml +++ b/pkgs/dart_flutter_team_lints/pubspec.yaml @@ -1,6 +1,6 @@ name: dart_flutter_team_lints description: An analysis rule set used by the Dart and Flutter teams. -version: 2.1.2-wip +version: 2.2.0 repository: https://github.com/dart-lang/ecosystem/tree/main/pkgs/dart_flutter_team_lints environment: diff --git a/tool/ci.sh b/tool/ci.sh index 9b4f6fff..f8afe275 100755 --- a/tool/ci.sh +++ b/tool/ci.sh @@ -1,9 +1,10 @@ #!/bin/bash -# Created with package:mono_repo v6.6.0 +# Created with package:mono_repo v6.6.1 # Support built in commands on windows out of the box. + # When it is a flutter repo (check the pubspec.yaml for "sdk: flutter") -# then "flutter" is called instead of "pub". +# then "flutter pub" is called instead of "dart pub". # This assumes that the Flutter SDK has been installed in a previous step. function pub() { if grep -Fq "sdk: flutter" "${PWD}/pubspec.yaml"; then @@ -12,18 +13,13 @@ function pub() { command dart pub "$@" fi } -# When it is a flutter repo (check the pubspec.yaml for "sdk: flutter") -# then "flutter" is called instead of "pub". -# This assumes that the Flutter SDK has been installed in a previous step. + function format() { - if grep -Fq "sdk: flutter" "${PWD}/pubspec.yaml"; then - command flutter format "$@" - else - command dart format "$@" - fi + command dart format "$@" } + # When it is a flutter repo (check the pubspec.yaml for "sdk: flutter") -# then "flutter" is called instead of "pub". +# then "flutter analyze" is called instead of "dart analyze". # This assumes that the Flutter SDK has been installed in a previous step. function analyze() { if grep -Fq "sdk: flutter" "${PWD}/pubspec.yaml"; then From 9f6d5d3e55c37fe2165d830543d38c7ad4e72be1 Mon Sep 17 00:00:00 2001 From: Devon Carew Date: Mon, 29 Apr 2024 12:00:30 -0700 Subject: [PATCH 2/4] require dart 3.4 --- .github/workflows/dart.yml | 113 ++++++++++++++-------- pkgs/dart_flutter_team_lints/CHANGELOG.md | 1 + pkgs/dart_flutter_team_lints/pubspec.yaml | 2 +- 3 files changed, 74 insertions(+), 42 deletions(-) diff --git a/.github/workflows/dart.yml b/.github/workflows/dart.yml index a79686cd..ed8d45c9 100644 --- a/.github/workflows/dart.yml +++ b/.github/workflows/dart.yml @@ -39,16 +39,16 @@ jobs: - name: mono_repo self validate run: dart pub global run mono_repo generate --validate job_002: - name: "analyze_and_format; Dart 3.0.0; PKGS: pkgs/corpus, pkgs/dart_flutter_team_lints, pkgs/firehose, pkgs/repo_manage; `dart analyze --fatal-infos .`" + name: "analyze_and_format; Dart 3.0.0; PKGS: pkgs/corpus, pkgs/firehose, pkgs/repo_manage; `dart analyze --fatal-infos .`" runs-on: ubuntu-latest steps: - name: Cache Pub hosted dependencies uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 with: path: "~/.pub-cache/hosted" - key: "os:ubuntu-latest;pub-cache-hosted;sdk:3.0.0;packages:pkgs/corpus-pkgs/dart_flutter_team_lints-pkgs/firehose-pkgs/repo_manage;commands:analyze" + key: "os:ubuntu-latest;pub-cache-hosted;sdk:3.0.0;packages:pkgs/corpus-pkgs/firehose-pkgs/repo_manage;commands:analyze" restore-keys: | - os:ubuntu-latest;pub-cache-hosted;sdk:3.0.0;packages:pkgs/corpus-pkgs/dart_flutter_team_lints-pkgs/firehose-pkgs/repo_manage + os:ubuntu-latest;pub-cache-hosted;sdk:3.0.0;packages:pkgs/corpus-pkgs/firehose-pkgs/repo_manage os:ubuntu-latest;pub-cache-hosted;sdk:3.0.0 os:ubuntu-latest;pub-cache-hosted os:ubuntu-latest @@ -68,15 +68,6 @@ jobs: run: dart analyze --fatal-infos . if: "always() && steps.pkgs_corpus_pub_upgrade.conclusion == 'success'" working-directory: pkgs/corpus - - id: pkgs_dart_flutter_team_lints_pub_upgrade - name: pkgs/dart_flutter_team_lints; dart pub upgrade - run: dart pub upgrade - if: "always() && steps.checkout.conclusion == 'success'" - working-directory: pkgs/dart_flutter_team_lints - - name: "pkgs/dart_flutter_team_lints; dart analyze --fatal-infos ." - run: dart analyze --fatal-infos . - if: "always() && steps.pkgs_dart_flutter_team_lints_pub_upgrade.conclusion == 'success'" - working-directory: pkgs/dart_flutter_team_lints - id: pkgs_firehose_pub_upgrade name: pkgs/firehose; dart pub upgrade run: dart pub upgrade @@ -98,6 +89,38 @@ jobs: needs: - job_001 job_003: + name: "analyze_and_format; Dart 3.4.0; PKG: pkgs/dart_flutter_team_lints; `dart analyze --fatal-infos .`" + runs-on: ubuntu-latest + steps: + - name: Cache Pub hosted dependencies + uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 + with: + path: "~/.pub-cache/hosted" + key: "os:ubuntu-latest;pub-cache-hosted;sdk:3.4.0;packages:pkgs/dart_flutter_team_lints;commands:analyze" + restore-keys: | + os:ubuntu-latest;pub-cache-hosted;sdk:3.4.0;packages:pkgs/dart_flutter_team_lints + os:ubuntu-latest;pub-cache-hosted;sdk:3.4.0 + os:ubuntu-latest;pub-cache-hosted + os:ubuntu-latest + - name: Setup Dart SDK + uses: dart-lang/setup-dart@fedb1266e91cf51be2fdb382869461a434b920a3 + with: + sdk: "3.4.0" + - id: checkout + name: Checkout repository + uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 + - id: pkgs_dart_flutter_team_lints_pub_upgrade + name: pkgs/dart_flutter_team_lints; dart pub upgrade + run: dart pub upgrade + if: "always() && steps.checkout.conclusion == 'success'" + working-directory: pkgs/dart_flutter_team_lints + - name: "pkgs/dart_flutter_team_lints; dart analyze --fatal-infos ." + run: dart analyze --fatal-infos . + if: "always() && steps.pkgs_dart_flutter_team_lints_pub_upgrade.conclusion == 'success'" + working-directory: pkgs/dart_flutter_team_lints + needs: + - job_001 + job_004: name: "analyze_and_format; Dart dev; PKGS: pkgs/corpus, pkgs/dart_flutter_team_lints, pkgs/firehose, pkgs/repo_manage; `dart analyze --fatal-infos .`" runs-on: ubuntu-latest steps: @@ -156,7 +179,7 @@ jobs: working-directory: pkgs/repo_manage needs: - job_001 - job_004: + job_005: name: "analyze_and_format; Dart dev; PKGS: pkgs/corpus, pkgs/dart_flutter_team_lints, pkgs/firehose, pkgs/repo_manage; `dart format --output=none --set-exit-if-changed .`" runs-on: ubuntu-latest steps: @@ -215,7 +238,7 @@ jobs: working-directory: pkgs/repo_manage needs: - job_001 - job_005: + job_006: name: "unit_test; Dart 3.0.0; PKG: pkgs/corpus; `dart test`" runs-on: ubuntu-latest steps: @@ -250,17 +273,18 @@ jobs: - job_002 - job_003 - job_004 - job_006: - name: "unit_test; Dart 3.0.0; PKG: pkgs/dart_flutter_team_lints; `dart test`" + - job_005 + job_007: + name: "unit_test; Dart 3.0.0; PKG: pkgs/firehose; `dart test`" runs-on: ubuntu-latest steps: - name: Cache Pub hosted dependencies uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 with: path: "~/.pub-cache/hosted" - key: "os:ubuntu-latest;pub-cache-hosted;sdk:3.0.0;packages:pkgs/dart_flutter_team_lints;commands:test_1" + key: "os:ubuntu-latest;pub-cache-hosted;sdk:3.0.0;packages:pkgs/firehose;commands:test_1" restore-keys: | - os:ubuntu-latest;pub-cache-hosted;sdk:3.0.0;packages:pkgs/dart_flutter_team_lints + os:ubuntu-latest;pub-cache-hosted;sdk:3.0.0;packages:pkgs/firehose os:ubuntu-latest;pub-cache-hosted;sdk:3.0.0 os:ubuntu-latest;pub-cache-hosted os:ubuntu-latest @@ -271,56 +295,58 @@ jobs: - id: checkout name: Checkout repository uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 - - id: pkgs_dart_flutter_team_lints_pub_upgrade - name: pkgs/dart_flutter_team_lints; dart pub upgrade + - id: pkgs_firehose_pub_upgrade + name: pkgs/firehose; dart pub upgrade run: dart pub upgrade if: "always() && steps.checkout.conclusion == 'success'" - working-directory: pkgs/dart_flutter_team_lints - - name: pkgs/dart_flutter_team_lints; dart test + working-directory: pkgs/firehose + - name: pkgs/firehose; dart test run: dart test - if: "always() && steps.pkgs_dart_flutter_team_lints_pub_upgrade.conclusion == 'success'" - working-directory: pkgs/dart_flutter_team_lints + if: "always() && steps.pkgs_firehose_pub_upgrade.conclusion == 'success'" + working-directory: pkgs/firehose needs: - job_001 - job_002 - job_003 - job_004 - job_007: - name: "unit_test; Dart 3.0.0; PKG: pkgs/firehose; `dart test`" + - job_005 + job_008: + name: "unit_test; Dart 3.4.0; PKG: pkgs/dart_flutter_team_lints; `dart test`" runs-on: ubuntu-latest steps: - name: Cache Pub hosted dependencies uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 with: path: "~/.pub-cache/hosted" - key: "os:ubuntu-latest;pub-cache-hosted;sdk:3.0.0;packages:pkgs/firehose;commands:test_1" + key: "os:ubuntu-latest;pub-cache-hosted;sdk:3.4.0;packages:pkgs/dart_flutter_team_lints;commands:test_1" restore-keys: | - os:ubuntu-latest;pub-cache-hosted;sdk:3.0.0;packages:pkgs/firehose - os:ubuntu-latest;pub-cache-hosted;sdk:3.0.0 + os:ubuntu-latest;pub-cache-hosted;sdk:3.4.0;packages:pkgs/dart_flutter_team_lints + os:ubuntu-latest;pub-cache-hosted;sdk:3.4.0 os:ubuntu-latest;pub-cache-hosted os:ubuntu-latest - name: Setup Dart SDK uses: dart-lang/setup-dart@fedb1266e91cf51be2fdb382869461a434b920a3 with: - sdk: "3.0.0" + sdk: "3.4.0" - id: checkout name: Checkout repository uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 - - id: pkgs_firehose_pub_upgrade - name: pkgs/firehose; dart pub upgrade + - id: pkgs_dart_flutter_team_lints_pub_upgrade + name: pkgs/dart_flutter_team_lints; dart pub upgrade run: dart pub upgrade if: "always() && steps.checkout.conclusion == 'success'" - working-directory: pkgs/firehose - - name: pkgs/firehose; dart test + working-directory: pkgs/dart_flutter_team_lints + - name: pkgs/dart_flutter_team_lints; dart test run: dart test - if: "always() && steps.pkgs_firehose_pub_upgrade.conclusion == 'success'" - working-directory: pkgs/firehose + if: "always() && steps.pkgs_dart_flutter_team_lints_pub_upgrade.conclusion == 'success'" + working-directory: pkgs/dart_flutter_team_lints needs: - job_001 - job_002 - job_003 - job_004 - job_008: + - job_005 + job_009: name: "unit_test; Dart dev; PKG: pkgs/corpus; `dart test`" runs-on: ubuntu-latest steps: @@ -355,7 +381,8 @@ jobs: - job_002 - job_003 - job_004 - job_009: + - job_005 + job_010: name: "unit_test; Dart dev; PKG: pkgs/dart_flutter_team_lints; `dart test`" runs-on: ubuntu-latest steps: @@ -390,7 +417,8 @@ jobs: - job_002 - job_003 - job_004 - job_010: + - job_005 + job_011: name: "unit_test; Dart dev; PKG: pkgs/firehose; `dart test`" runs-on: ubuntu-latest steps: @@ -425,7 +453,8 @@ jobs: - job_002 - job_003 - job_004 - job_011: + - job_005 + job_012: name: "analyze_format; Dart dev; PKG: pkgs/blast_repo; `dart format --output=none --set-exit-if-changed .`, `dart analyze --fatal-infos .`" runs-on: ubuntu-latest steps: @@ -470,7 +499,8 @@ jobs: - job_008 - job_009 - job_010 - job_012: + - job_011 + job_013: name: "test; Dart dev; PKG: pkgs/blast_repo; `dart test --test-randomize-ordering-seed=random`" runs-on: ubuntu-latest steps: @@ -512,3 +542,4 @@ jobs: - job_009 - job_010 - job_011 + - job_012 diff --git a/pkgs/dart_flutter_team_lints/CHANGELOG.md b/pkgs/dart_flutter_team_lints/CHANGELOG.md index 34e0311f..597f2fa5 100644 --- a/pkgs/dart_flutter_team_lints/CHANGELOG.md +++ b/pkgs/dart_flutter_team_lints/CHANGELOG.md @@ -1,6 +1,7 @@ ## 2.2.0 - Added `unnecessary_library_name`. +- Require Dart `3.4`. ## 2.1.1 diff --git a/pkgs/dart_flutter_team_lints/pubspec.yaml b/pkgs/dart_flutter_team_lints/pubspec.yaml index aa849f3f..2801eb1f 100644 --- a/pkgs/dart_flutter_team_lints/pubspec.yaml +++ b/pkgs/dart_flutter_team_lints/pubspec.yaml @@ -4,7 +4,7 @@ version: 2.2.0 repository: https://github.com/dart-lang/ecosystem/tree/main/pkgs/dart_flutter_team_lints environment: - sdk: ^3.0.0 + sdk: ^3.4.0 dependencies: lints: ^3.0.0 From da7f1eccf7667d44018963bfe26182b73263d15d Mon Sep 17 00:00:00 2001 From: Devon Carew Date: Mon, 13 May 2024 13:55:24 -0700 Subject: [PATCH 3/4] update package:dart_flutter_team_lints deps --- pkgs/blast_repo/pubspec.yaml | 2 +- pkgs/corpus/pubspec.yaml | 2 +- pkgs/firehose/pubspec.yaml | 2 +- pkgs/repo_manage/pubspec.yaml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pkgs/blast_repo/pubspec.yaml b/pkgs/blast_repo/pubspec.yaml index 6c2522ec..0b8eae9c 100644 --- a/pkgs/blast_repo/pubspec.yaml +++ b/pkgs/blast_repo/pubspec.yaml @@ -20,7 +20,7 @@ dependencies: yaml_edit: ^2.1.0 dev_dependencies: - dart_flutter_team_lints: ^2.0.0 + dart_flutter_team_lints: ^3.0.0 test: ^1.22.0 test_descriptor: ^2.0.0 diff --git a/pkgs/corpus/pubspec.yaml b/pkgs/corpus/pubspec.yaml index e27019c5..ff49626e 100644 --- a/pkgs/corpus/pubspec.yaml +++ b/pkgs/corpus/pubspec.yaml @@ -18,6 +18,6 @@ dependencies: dev_dependencies: checks: ^0.3.0 - dart_flutter_team_lints: ^2.0.0 + dart_flutter_team_lints: ^3.0.0 test: ^1.22.0 test_descriptor: ^2.0.0 diff --git a/pkgs/firehose/pubspec.yaml b/pkgs/firehose/pubspec.yaml index 90cda460..f6a6b6ef 100644 --- a/pkgs/firehose/pubspec.yaml +++ b/pkgs/firehose/pubspec.yaml @@ -22,5 +22,5 @@ dependencies: yaml: ^3.1.0 dev_dependencies: - dart_flutter_team_lints: ^2.0.0 + dart_flutter_team_lints: ^3.0.0 test: ^1.21.0 diff --git a/pkgs/repo_manage/pubspec.yaml b/pkgs/repo_manage/pubspec.yaml index 41256871..8292b173 100644 --- a/pkgs/repo_manage/pubspec.yaml +++ b/pkgs/repo_manage/pubspec.yaml @@ -14,4 +14,4 @@ dependencies: path: ^1.8.0 dev_dependencies: - dart_flutter_team_lints: ^2.0.0 + dart_flutter_team_lints: ^3.0.0 From 173ac8282659ee5478b16f8a8421a62f74e03f63 Mon Sep 17 00:00:00 2001 From: Devon Carew Date: Mon, 13 May 2024 14:03:46 -0700 Subject: [PATCH 4/4] remove the local pubspec_overrides.yaml files --- pkgs/corpus/pubspec_overrides.yaml | 3 --- pkgs/firehose/pubspec_overrides.yaml | 3 --- pkgs/repo_manage/pubspec_overrides.yaml | 3 --- 3 files changed, 9 deletions(-) delete mode 100644 pkgs/corpus/pubspec_overrides.yaml delete mode 100644 pkgs/firehose/pubspec_overrides.yaml delete mode 100644 pkgs/repo_manage/pubspec_overrides.yaml diff --git a/pkgs/corpus/pubspec_overrides.yaml b/pkgs/corpus/pubspec_overrides.yaml deleted file mode 100644 index fbd1c0a8..00000000 --- a/pkgs/corpus/pubspec_overrides.yaml +++ /dev/null @@ -1,3 +0,0 @@ -dependency_overrides: - dart_flutter_team_lints: - path: ../dart_flutter_team_lints diff --git a/pkgs/firehose/pubspec_overrides.yaml b/pkgs/firehose/pubspec_overrides.yaml deleted file mode 100644 index fbd1c0a8..00000000 --- a/pkgs/firehose/pubspec_overrides.yaml +++ /dev/null @@ -1,3 +0,0 @@ -dependency_overrides: - dart_flutter_team_lints: - path: ../dart_flutter_team_lints diff --git a/pkgs/repo_manage/pubspec_overrides.yaml b/pkgs/repo_manage/pubspec_overrides.yaml deleted file mode 100644 index fbd1c0a8..00000000 --- a/pkgs/repo_manage/pubspec_overrides.yaml +++ /dev/null @@ -1,3 +0,0 @@ -dependency_overrides: - dart_flutter_team_lints: - path: ../dart_flutter_team_lints