From 2719d0c077d76da6fb996820393f3cd96bec6591 Mon Sep 17 00:00:00 2001 From: Devon Carew Date: Thu, 8 Aug 2024 15:01:05 -0700 Subject: [PATCH] add invalid_runtime_check_with_js_interop_types, unintended_html_in_doc_comment (#285) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - add `invalid_runtime_check_with_js_interop_types` - add `unintended_html_in_doc_comment` - prep for publishing The idea behind this revision is to use the above two lints for a period of time ourselves (these lints are likely going out with the next major revision of `package:lints` - see https://github.com/orgs/dart-lang/projects/73). --- - [x] I’ve reviewed the contributor guide and applied the relevant portions to this PR.
Contribution guidelines:
- See our [contributor guide](https://github.com/dart-lang/.github/blob/main/CONTRIBUTING.md) for general expectations for PRs. - Larger or significant changes should be discussed in an issue before creating a PR. - Contributions to our repos should follow the [Dart style guide](https://dart.dev/guides/language/effective-dart) and use `dart format`. - Most changes should add an entry to the changelog and may need to [rev the pubspec package version](https://github.com/dart-lang/sdk/blob/main/docs/External-Package-Maintenance.md#making-a-change). - Changes to packages require [corresponding tests](https://github.com/dart-lang/.github/blob/main/CONTRIBUTING.md#Testing). Note that many Dart repos have a weekly cadence for reviewing PRs - please allow for some latency before initial review feedback.
--- .github/workflows/dart.yml | 123 +++++++++++------- pkgs/dart_flutter_team_lints/CHANGELOG.md | 7 +- .../lib/analysis_options.yaml | 2 + pkgs/dart_flutter_team_lints/pubspec.yaml | 4 +- tool/ci.sh | 2 +- 5 files changed, 88 insertions(+), 50 deletions(-) diff --git a/.github/workflows/dart.yml b/.github/workflows/dart.yml index 33d5414e..9e1e4bd0 100644 --- a/.github/workflows/dart.yml +++ b/.github/workflows/dart.yml @@ -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: @@ -35,7 +35,7 @@ jobs: name: Checkout repository uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 - 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: @@ -89,16 +89,16 @@ jobs: needs: - job_001 job_003: - name: "analyze_and_format; Dart 3.4.0; PKGS: pkgs/dart_flutter_team_lints, pkgs/sdk_triage_bot; `dart analyze --fatal-infos .`" + name: "analyze_and_format; Dart 3.4.0; PKG: pkgs/sdk_triage_bot; `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-pkgs/sdk_triage_bot;commands:analyze" + key: "os:ubuntu-latest;pub-cache-hosted;sdk:3.4.0;packages:pkgs/sdk_triage_bot;commands:analyze" restore-keys: | - os:ubuntu-latest;pub-cache-hosted;sdk:3.4.0;packages:pkgs/dart_flutter_team_lints-pkgs/sdk_triage_bot + os:ubuntu-latest;pub-cache-hosted;sdk:3.4.0;packages:pkgs/sdk_triage_bot os:ubuntu-latest;pub-cache-hosted;sdk:3.4.0 os:ubuntu-latest;pub-cache-hosted os:ubuntu-latest @@ -109,15 +109,6 @@ jobs: - id: checkout name: Checkout repository uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 - - 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_sdk_triage_bot_pub_upgrade name: pkgs/sdk_triage_bot; dart pub upgrade run: dart pub upgrade @@ -130,6 +121,38 @@ jobs: needs: - job_001 job_004: + name: "analyze_and_format; Dart 3.5.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.5.0;packages:pkgs/dart_flutter_team_lints;commands:analyze" + restore-keys: | + os:ubuntu-latest;pub-cache-hosted;sdk:3.5.0;packages:pkgs/dart_flutter_team_lints + os:ubuntu-latest;pub-cache-hosted;sdk:3.5.0 + os:ubuntu-latest;pub-cache-hosted + os:ubuntu-latest + - name: Setup Dart SDK + uses: dart-lang/setup-dart@0a8a0fc875eb934c15d08629302413c671d3f672 + with: + sdk: "3.5.0" + - id: checkout + name: Checkout repository + uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 + - 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_005: name: "analyze_and_format; Dart dev; PKGS: pkgs/corpus, pkgs/dart_flutter_team_lints, pkgs/firehose, pkgs/repo_manage, pkgs/sdk_triage_bot; `dart analyze --fatal-infos .`" runs-on: ubuntu-latest steps: @@ -197,7 +220,7 @@ jobs: working-directory: pkgs/sdk_triage_bot needs: - job_001 - job_005: + job_006: name: "analyze_and_format; Dart dev; PKGS: pkgs/corpus, pkgs/dart_flutter_team_lints, pkgs/firehose, pkgs/repo_manage, pkgs/sdk_triage_bot; `dart format --output=none --set-exit-if-changed .`" runs-on: ubuntu-latest steps: @@ -265,7 +288,7 @@ jobs: working-directory: pkgs/sdk_triage_bot needs: - job_001 - job_006: + job_007: name: "unit_test; Dart 3.1.0; PKG: pkgs/corpus; `dart test`" runs-on: ubuntu-latest steps: @@ -301,7 +324,8 @@ jobs: - job_003 - job_004 - job_005 - job_007: + - job_006 + job_008: name: "unit_test; Dart 3.1.0; PKG: pkgs/firehose; `dart test`" runs-on: ubuntu-latest steps: @@ -337,17 +361,18 @@ jobs: - job_003 - job_004 - job_005 - job_008: - name: "unit_test; Dart 3.4.0; PKG: pkgs/dart_flutter_team_lints; `dart test`" + - job_006 + job_009: + name: "unit_test; Dart 3.4.0; PKG: pkgs/sdk_triage_bot; `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.4.0;packages:pkgs/dart_flutter_team_lints;commands:test_1" + key: "os:ubuntu-latest;pub-cache-hosted;sdk:3.4.0;packages:pkgs/sdk_triage_bot;commands:test_1" 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;packages:pkgs/sdk_triage_bot os:ubuntu-latest;pub-cache-hosted;sdk:3.4.0 os:ubuntu-latest;pub-cache-hosted os:ubuntu-latest @@ -358,58 +383,60 @@ jobs: - id: checkout name: Checkout repository uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 - - id: pkgs_dart_flutter_team_lints_pub_upgrade - name: pkgs/dart_flutter_team_lints; dart pub upgrade + - id: pkgs_sdk_triage_bot_pub_upgrade + name: pkgs/sdk_triage_bot; 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/sdk_triage_bot + - name: pkgs/sdk_triage_bot; 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_sdk_triage_bot_pub_upgrade.conclusion == 'success'" + working-directory: pkgs/sdk_triage_bot needs: - job_001 - job_002 - job_003 - job_004 - job_005 - job_009: - name: "unit_test; Dart 3.4.0; PKG: pkgs/sdk_triage_bot; `dart test`" + - job_006 + job_010: + name: "unit_test; Dart 3.5.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.4.0;packages:pkgs/sdk_triage_bot;commands:test_1" + key: "os:ubuntu-latest;pub-cache-hosted;sdk:3.5.0;packages:pkgs/dart_flutter_team_lints;commands:test_1" restore-keys: | - os:ubuntu-latest;pub-cache-hosted;sdk:3.4.0;packages:pkgs/sdk_triage_bot - os:ubuntu-latest;pub-cache-hosted;sdk:3.4.0 + os:ubuntu-latest;pub-cache-hosted;sdk:3.5.0;packages:pkgs/dart_flutter_team_lints + os:ubuntu-latest;pub-cache-hosted;sdk:3.5.0 os:ubuntu-latest;pub-cache-hosted os:ubuntu-latest - name: Setup Dart SDK uses: dart-lang/setup-dart@0a8a0fc875eb934c15d08629302413c671d3f672 with: - sdk: "3.4.0" + sdk: "3.5.0" - id: checkout name: Checkout repository uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 - - id: pkgs_sdk_triage_bot_pub_upgrade - name: pkgs/sdk_triage_bot; 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/sdk_triage_bot - - name: pkgs/sdk_triage_bot; dart test + working-directory: pkgs/dart_flutter_team_lints + - name: pkgs/dart_flutter_team_lints; dart test run: dart test - if: "always() && steps.pkgs_sdk_triage_bot_pub_upgrade.conclusion == 'success'" - working-directory: pkgs/sdk_triage_bot + 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_005 - job_010: + - job_006 + job_011: name: "unit_test; Dart dev; PKG: pkgs/corpus; `dart test`" runs-on: ubuntu-latest steps: @@ -445,7 +472,8 @@ jobs: - job_003 - job_004 - job_005 - job_011: + - job_006 + job_012: name: "unit_test; Dart dev; PKG: pkgs/dart_flutter_team_lints; `dart test`" runs-on: ubuntu-latest steps: @@ -481,7 +509,8 @@ jobs: - job_003 - job_004 - job_005 - job_012: + - job_006 + job_013: name: "unit_test; Dart dev; PKG: pkgs/firehose; `dart test`" runs-on: ubuntu-latest steps: @@ -517,7 +546,8 @@ jobs: - job_003 - job_004 - job_005 - job_013: + - job_006 + job_014: name: "unit_test; Dart dev; PKG: pkgs/sdk_triage_bot; `dart test`" runs-on: ubuntu-latest steps: @@ -553,7 +583,8 @@ jobs: - job_003 - job_004 - job_005 - job_014: + - job_006 + job_015: 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: @@ -601,7 +632,8 @@ jobs: - job_011 - job_012 - job_013 - job_015: + - job_014 + job_016: name: "test; Dart dev; PKG: pkgs/blast_repo; `dart test --test-randomize-ordering-seed=random`" runs-on: ubuntu-latest steps: @@ -646,3 +678,4 @@ jobs: - job_012 - job_013 - job_014 + - job_015 diff --git a/pkgs/dart_flutter_team_lints/CHANGELOG.md b/pkgs/dart_flutter_team_lints/CHANGELOG.md index 00c165c5..63b1d727 100644 --- a/pkgs/dart_flutter_team_lints/CHANGELOG.md +++ b/pkgs/dart_flutter_team_lints/CHANGELOG.md @@ -1,6 +1,9 @@ -## 3.1.1-wip +## 3.2.0 -- Contribute a (brief) change policy to the readme. +- Contributed a (brief) change policy to the readme. +- Added `invalid_runtime_check_with_js_interop_types`. +- Added `unintended_html_in_doc_comment`. +- Require Dart `3.5`. ## 3.1.0 diff --git a/pkgs/dart_flutter_team_lints/lib/analysis_options.yaml b/pkgs/dart_flutter_team_lints/lib/analysis_options.yaml index 6bbadef3..efb5ffb8 100644 --- a/pkgs/dart_flutter_team_lints/lib/analysis_options.yaml +++ b/pkgs/dart_flutter_team_lints/lib/analysis_options.yaml @@ -45,9 +45,11 @@ linter: - avoid_dynamic_calls - comment_references - conditional_uri_does_not_exist + - invalid_runtime_check_with_js_interop_types - only_throw_errors - test_types_in_equals - throw_in_finally - type_annotate_public_apis - unawaited_futures + - unintended_html_in_doc_comment - unreachable_from_main diff --git a/pkgs/dart_flutter_team_lints/pubspec.yaml b/pkgs/dart_flutter_team_lints/pubspec.yaml index af29b4a7..26cfb83d 100644 --- a/pkgs/dart_flutter_team_lints/pubspec.yaml +++ b/pkgs/dart_flutter_team_lints/pubspec.yaml @@ -1,10 +1,10 @@ name: dart_flutter_team_lints description: An analysis rule set used by the Dart and Flutter teams. -version: 3.1.1-wip +version: 3.2.0 repository: https://github.com/dart-lang/ecosystem/tree/main/pkgs/dart_flutter_team_lints environment: - sdk: ^3.4.0 + sdk: ^3.5.0 dependencies: lints: ^4.0.0 diff --git a/tool/ci.sh b/tool/ci.sh index f8afe275..72af8590 100755 --- a/tool/ci.sh +++ b/tool/ci.sh @@ -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.