From 7b0f5562d269cb46ad371553dd5abaa64cc1fa3b Mon Sep 17 00:00:00 2001 From: Parker Lougheed Date: Mon, 23 Oct 2023 11:28:25 -0500 Subject: [PATCH 01/12] Remove mention of no_wildcard_variable_uses from changelog (#164) --- CHANGELOG.md | 1 - tool/rules.json | 5 +++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4b1032d..4924517 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,7 +9,6 @@ - added `use_string_in_part_of_directives` - removed `iterable_contains_unrelated_type` - removed `list_remove_unrelated_type` - - removed `no_wildcard_variable_uses` - `recommended`: - added `unnecessary_to_list_in_spreads` - added `use_super_parameters` diff --git a/tool/rules.json b/tool/rules.json index 72f8b06..fc501a2 100644 --- a/tool/rules.json +++ b/tool/rules.json @@ -44,6 +44,11 @@ "description": "Avoid types as parameter names.", "fixStatus": "hasFix" }, + { + "name": "avoid_unstable_final_fields", + "description": "Avoid overriding a final field to return different values if called multiple times.", + "fixStatus": "noFix" + }, { "name": "avoid_web_libraries_in_flutter", "description": "Avoid using web-only libraries outside Flutter web plugin packages.", From 2cf8403407168d5a1e5c8faed443d4d140308c91 Mon Sep 17 00:00:00 2001 From: Devon Carew Date: Mon, 23 Oct 2023 11:05:53 -0700 Subject: [PATCH 02/12] add no_wildcard_variable_uses; rev to a new major version (#165) * add no_wildcard_variable_uses; rev to a new major version * regen docs * test against sdk 3.1 --- .github/workflows/validate.yml | 4 ++-- CHANGELOG.md | 6 ++++++ lib/core.yaml | 1 + pubspec.yaml | 4 ++-- rules.md | 1 + 5 files changed, 12 insertions(+), 4 deletions(-) diff --git a/.github/workflows/validate.yml b/.github/workflows/validate.yml index cd5f03c..f85a795 100644 --- a/.github/workflows/validate.yml +++ b/.github/workflows/validate.yml @@ -17,11 +17,11 @@ jobs: strategy: fail-fast: false matrix: - sdk: [3.0.0, stable, beta] + sdk: [3.1, stable, beta] steps: - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 - - uses: dart-lang/setup-dart@8a4b97ea2017cc079571daec46542f76189836b1 + - uses: dart-lang/setup-dart@b64355ae6ca0b5d484f0106a033dd1388965d06d with: sdk: ${{ matrix.sdk }} diff --git a/CHANGELOG.md b/CHANGELOG.md index 4924517..11978f7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +## 4.0.0-wip + +- `core`: + - added `no_wildcard_variable_uses` +- Updated the SDK lower-bound to 3.1. + ## 3.0.0 - `core`: diff --git a/lib/core.yaml b/lib/core.yaml index e986edc..990d753 100644 --- a/lib/core.yaml +++ b/lib/core.yaml @@ -22,6 +22,7 @@ linter: - hash_and_equals - implicit_call_tearoffs - no_duplicate_case_values + - no_wildcard_variable_uses - non_constant_identifier_names - null_check_on_nullable_type_parameter - package_prefixed_library_names diff --git a/pubspec.yaml b/pubspec.yaml index 647ffa7..6c02d5b 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,5 +1,5 @@ name: lints -version: 3.0.0 +version: 4.0.0-wip description: > Official Dart lint rules. Defines the 'core' and 'recommended' set of lints suggested by the Dart team. @@ -10,7 +10,7 @@ topics: - lints environment: - sdk: ^3.0.0 + sdk: ^3.1.0 # NOTE: Code is not allowed in this package - do not add dependencies. # dependencies: diff --git a/rules.md b/rules.md index 70dee71..04e3921 100644 --- a/rules.md +++ b/rules.md @@ -21,6 +21,7 @@ | [`hash_and_equals`](https://dart.dev/lints/hash_and_equals) | Always override `hashCode` if overriding `==`. | ✅ | | [`implicit_call_tearoffs`](https://dart.dev/lints/implicit_call_tearoffs) | Explicitly tear-off `call` methods when using an object as a Function. | ✅ | | [`no_duplicate_case_values`](https://dart.dev/lints/no_duplicate_case_values) | Don't use more than one case with same value. | ✅ | +| [`no_wildcard_variable_uses`](https://dart.dev/lints/no_wildcard_variable_uses) | Don't use wildcard parameters or variables. | | | [`non_constant_identifier_names`](https://dart.dev/lints/non_constant_identifier_names) | Name non-constant identifiers using lowerCamelCase. | ✅ | | [`null_check_on_nullable_type_parameter`](https://dart.dev/lints/null_check_on_nullable_type_parameter) | Don't use null check on a potentially nullable type parameter. | ✅ | | [`package_prefixed_library_names`](https://dart.dev/lints/package_prefixed_library_names) | Prefix library names with the package name and a dot-separated path. | | From 5c60f48a17e3e6c34dcbcd51fa16b11802340471 Mon Sep 17 00:00:00 2001 From: Michael Goderbauer Date: Mon, 30 Oct 2023 11:24:23 -0700 Subject: [PATCH 03/12] Update README.md to use new syntax for adding dev dependencies (#167) As documented here: https://dart.dev/tools/pub/cmd/pub-add#dev-dependency --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 827228b..7349a5d 100644 --- a/README.md +++ b/README.md @@ -55,7 +55,7 @@ For existing apps or packages, you can enable these lints via: 1. In a terminal, located at the root of your package, run this command: ```terminal - dart pub add --dev lints + dart pub add dev:lints ``` 2. Create a new `analysis_options.yaml` file, next to the pubspec, that From f58fd77bbff4ff4a62826a7bbfb9a72f0f03dd3c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 1 Nov 2023 10:23:19 +0000 Subject: [PATCH 04/12] Bump actions/checkout from 4.1.0 to 4.1.1 (#168) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Bumps [actions/checkout](https://github.com/actions/checkout) from 4.1.0 to 4.1.1.
Release notes

Sourced from actions/checkout's releases.

v4.1.1

What's Changed

New Contributors

Full Changelog: https://github.com/actions/checkout/compare/v4.1.0...v4.1.1

Commits

[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=actions/checkout&package-manager=github_actions&previous-version=4.1.0&new-version=4.1.1)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. ---
Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot show ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
--- .github/workflows/validate.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/validate.yml b/.github/workflows/validate.yml index f85a795..3d22444 100644 --- a/.github/workflows/validate.yml +++ b/.github/workflows/validate.yml @@ -20,7 +20,7 @@ jobs: sdk: [3.1, stable, beta] steps: - - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 + - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 - uses: dart-lang/setup-dart@b64355ae6ca0b5d484f0106a033dd1388965d06d with: sdk: ${{ matrix.sdk }} From 3810f8b3dc3205cfaa4ccc0054b021e68046d851 Mon Sep 17 00:00:00 2001 From: Devon Carew Date: Tue, 14 Nov 2023 10:14:35 -0800 Subject: [PATCH 05/12] add a section on upgrading to the latest lint set to the readme (#171) --- CHANGELOG.md | 1 + README.md | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 11978f7..0b76fbc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ - `core`: - added `no_wildcard_variable_uses` - Updated the SDK lower-bound to 3.1. +- Add a section on upgrading to the latest lint set to the readme. ## 3.0.0 diff --git a/README.md b/README.md index 7349a5d..c43af1c 100644 --- a/README.md +++ b/README.md @@ -71,6 +71,14 @@ For existing apps or packages, you can enable these lints via: include: package:lints/core.yaml ``` +## Upgrading to the latest lints + +To upgrade to the latest version of the lint set, run: + +``` +dart pub add dev:lints +``` + ## Customizing the predefined lint sets For details on customizing static analysis above and beyond the predefined From 90a61e474e7b69cdb5ac9b8761722430ed146e9e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 1 Feb 2024 10:59:46 +0000 Subject: [PATCH 06/12] Bump dart-lang/setup-dart from 1.6.0 to 1.6.2 (#176) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Bumps [dart-lang/setup-dart](https://github.com/dart-lang/setup-dart) from 1.6.0 to 1.6.2.
Release notes

Sourced from dart-lang/setup-dart's releases.

v1.6.2

v1.6.1

  • Updated the google storage url for main channel releases.
Changelog

Sourced from dart-lang/setup-dart's changelog.

v1.6.2

v1.6.1

  • Updated the google storage url for main channel releases.

v1.6.0

  • Enable provisioning of the latest Dart SDK patch release by specifying just the major and minor version (e.g. 3.2).

v1.5.1

  • No longer test the setup-dart action on pre-2.12 SDKs.
  • Upgrade JS interop code to use extension types (the new name for inline classes).
  • The upcoming rename of the be channel to main is now supported with forward compatibility that switches when the rename happens.

v1.5.0

  • Re-wrote the implementation of the action into Dart.
  • Auto-detect the platform architecture (x64, ia32, arm, arm64).
  • Improved the caching and download resilience of the sdk.
  • Added a new action output: dart-version - the installed version of the sdk.

v1.4.0

  • Automatically create OIDC token for pub.dev.
  • Add a reusable workflow for publishing.

v1.3.0

  • The install location of the Dart SDK is now available in an environment variable, DART_HOME (#43).
  • Fixed an issue where cached downloads could lead to unzip issues on self-hosted runners (#35).

v1.2.0

  • Fixed a path issue impacting git dependencies on Windows.

v1.1.0

... (truncated)

Commits

[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=dart-lang/setup-dart&package-manager=github_actions&previous-version=1.6.0&new-version=1.6.2)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. ---
Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot show ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
--- .github/workflows/validate.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/validate.yml b/.github/workflows/validate.yml index 3d22444..eead84f 100644 --- a/.github/workflows/validate.yml +++ b/.github/workflows/validate.yml @@ -21,7 +21,7 @@ jobs: steps: - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 - - uses: dart-lang/setup-dart@b64355ae6ca0b5d484f0106a033dd1388965d06d + - uses: dart-lang/setup-dart@fedb1266e91cf51be2fdb382869461a434b920a3 with: sdk: ${{ matrix.sdk }} From ead770872e272e25a64315c120950ea8ad5b2509 Mon Sep 17 00:00:00 2001 From: Devon Carew Date: Thu, 8 Feb 2024 18:31:06 -0800 Subject: [PATCH 07/12] add library_annotations; remove package_prefixed_library_names (#179) --- CHANGELOG.md | 4 +++- lib/core.yaml | 2 +- rules.md | 4 ++-- tool/rules.json | 2 +- 4 files changed, 7 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0b76fbc..bdd9ea7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,7 +1,9 @@ ## 4.0.0-wip - `core`: - - added `no_wildcard_variable_uses` + - added `library_annotations` (https://github.com/dart-lang/lints/issues/177) + - added `no_wildcard_variable_uses` (https://github.com/dart-lang/lints/issues/139) + - removed `package_prefixed_library_names` (https://github.com/dart-lang/lints/issues/172) - Updated the SDK lower-bound to 3.1. - Add a section on upgrading to the latest lint set to the readme. diff --git a/lib/core.yaml b/lib/core.yaml index 990d753..1cfe995 100644 --- a/lib/core.yaml +++ b/lib/core.yaml @@ -21,11 +21,11 @@ linter: - file_names - hash_and_equals - implicit_call_tearoffs + - library_annotations - no_duplicate_case_values - no_wildcard_variable_uses - non_constant_identifier_names - null_check_on_nullable_type_parameter - - package_prefixed_library_names - prefer_generic_function_type_aliases - prefer_is_empty - prefer_is_not_empty diff --git a/rules.md b/rules.md index 04e3921..2a4a5b9 100644 --- a/rules.md +++ b/rules.md @@ -5,7 +5,7 @@ | Lint Rules | Description | [Fix][] | | :--------- | :---------- | ------- | -| [`avoid_empty_else`](https://dart.dev/lints/avoid_empty_else) | Avoid empty else statements. | ✅ | +| [`avoid_empty_else`](https://dart.dev/lints/avoid_empty_else) | Avoid empty statements in else clauses. | ✅ | | [`avoid_relative_lib_imports`](https://dart.dev/lints/avoid_relative_lib_imports) | Avoid relative imports for files in `lib/`. | ✅ | | [`avoid_shadowing_type_parameters`](https://dart.dev/lints/avoid_shadowing_type_parameters) | Avoid shadowing type parameters. | | | [`avoid_types_as_parameter_names`](https://dart.dev/lints/avoid_types_as_parameter_names) | Avoid types as parameter names. | ✅ | @@ -20,11 +20,11 @@ | [`file_names`](https://dart.dev/lints/file_names) | Name source files using `lowercase_with_underscores`. | | | [`hash_and_equals`](https://dart.dev/lints/hash_and_equals) | Always override `hashCode` if overriding `==`. | ✅ | | [`implicit_call_tearoffs`](https://dart.dev/lints/implicit_call_tearoffs) | Explicitly tear-off `call` methods when using an object as a Function. | ✅ | +| [`library_annotations`](https://dart.dev/lints/library_annotations) | Attach library annotations to library directives. | ✅ | | [`no_duplicate_case_values`](https://dart.dev/lints/no_duplicate_case_values) | Don't use more than one case with same value. | ✅ | | [`no_wildcard_variable_uses`](https://dart.dev/lints/no_wildcard_variable_uses) | Don't use wildcard parameters or variables. | | | [`non_constant_identifier_names`](https://dart.dev/lints/non_constant_identifier_names) | Name non-constant identifiers using lowerCamelCase. | ✅ | | [`null_check_on_nullable_type_parameter`](https://dart.dev/lints/null_check_on_nullable_type_parameter) | Don't use null check on a potentially nullable type parameter. | ✅ | -| [`package_prefixed_library_names`](https://dart.dev/lints/package_prefixed_library_names) | Prefix library names with the package name and a dot-separated path. | | | [`prefer_generic_function_type_aliases`](https://dart.dev/lints/prefer_generic_function_type_aliases) | Prefer generic function type aliases. | ✅ | | [`prefer_is_empty`](https://dart.dev/lints/prefer_is_empty) | Use `isEmpty` for Iterables and Maps. | ✅ | | [`prefer_is_not_empty`](https://dart.dev/lints/prefer_is_not_empty) | Use `isNotEmpty` for Iterables and Maps. | ✅ | diff --git a/tool/rules.json b/tool/rules.json index fc501a2..a055005 100644 --- a/tool/rules.json +++ b/tool/rules.json @@ -11,7 +11,7 @@ }, { "name": "avoid_empty_else", - "description": "Avoid empty else statements.", + "description": "Avoid empty statements in else clauses.", "fixStatus": "hasFix" }, { From df9bcbf6dd8964468d0bfa0b1b7286cf850c1656 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 1 Apr 2024 10:12:03 +0000 Subject: [PATCH 08/12] Bump actions/checkout from 4.1.1 to 4.1.2 (#182) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Bumps [actions/checkout](https://github.com/actions/checkout) from 4.1.1 to 4.1.2.
Release notes

Sourced from actions/checkout's releases.

v4.1.2

We are investigating the following issue with this release and have rolled-back the v4 tag to point to v4.1.1

What's Changed

New Contributors

Full Changelog: https://github.com/actions/checkout/compare/v4.1.1...v4.1.2

Changelog

Sourced from actions/checkout's changelog.

Changelog

v4.1.2

v4.1.1

v4.1.0

v4.0.0

v3.6.0

v3.5.3

v3.5.2

v3.5.1

v3.5.0

v3.4.0

v3.3.0

v3.2.0

... (truncated)

Commits

[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=actions/checkout&package-manager=github_actions&previous-version=4.1.1&new-version=4.1.2)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. ---
Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot show ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
--- .github/workflows/validate.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/validate.yml b/.github/workflows/validate.yml index eead84f..f26245e 100644 --- a/.github/workflows/validate.yml +++ b/.github/workflows/validate.yml @@ -20,7 +20,7 @@ jobs: sdk: [3.1, stable, beta] steps: - - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 + - uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 - uses: dart-lang/setup-dart@fedb1266e91cf51be2fdb382869461a434b920a3 with: sdk: ${{ matrix.sdk }} From 7f63963a5a06396b697e03a076fe2d5cb5de407c Mon Sep 17 00:00:00 2001 From: Devon Carew Date: Tue, 30 Apr 2024 09:56:10 -0700 Subject: [PATCH 09/12] remove the 'library_names' lint (#183) --- CHANGELOG.md | 2 ++ lib/recommended.yaml | 1 - rules.md | 1 - tool/gen_docs.dart | 10 ++-------- tool/rules.json | 27 +++++++++++++++++++++------ 5 files changed, 25 insertions(+), 16 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index bdd9ea7..ec395c5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,8 @@ - added `library_annotations` (https://github.com/dart-lang/lints/issues/177) - added `no_wildcard_variable_uses` (https://github.com/dart-lang/lints/issues/139) - removed `package_prefixed_library_names` (https://github.com/dart-lang/lints/issues/172) +- `recommended`: + - removed `library_names` (https://github.com/dart-lang/lints/issues/181) - Updated the SDK lower-bound to 3.1. - Add a section on upgrading to the latest lint set to the readme. diff --git a/lib/recommended.yaml b/lib/recommended.yaml index d9cd916..eda84d6 100644 --- a/lib/recommended.yaml +++ b/lib/recommended.yaml @@ -25,7 +25,6 @@ linter: - empty_statements - exhaustive_cases - implementation_imports - - library_names - library_prefixes - library_private_types_in_public_api - no_leading_underscores_for_library_prefixes diff --git a/rules.md b/rules.md index 2a4a5b9..8b44b0e 100644 --- a/rules.md +++ b/rules.md @@ -59,7 +59,6 @@ | [`empty_statements`](https://dart.dev/lints/empty_statements) | Avoid empty statements. | ✅ | | [`exhaustive_cases`](https://dart.dev/lints/exhaustive_cases) | Define case clauses for all constants in enum-like classes. | ✅ | | [`implementation_imports`](https://dart.dev/lints/implementation_imports) | Don't import implementation files from another package. | | -| [`library_names`](https://dart.dev/lints/library_names) | Name libraries using `lowercase_with_underscores`. | | | [`library_prefixes`](https://dart.dev/lints/library_prefixes) | Use `lowercase_with_underscores` when specifying a library prefix. | | | [`library_private_types_in_public_api`](https://dart.dev/lints/library_private_types_in_public_api) | Avoid using private types in public APIs. | | | [`no_leading_underscores_for_library_prefixes`](https://dart.dev/lints/no_leading_underscores_for_library_prefixes) | Avoid leading underscores for library prefixes. | ✅ | diff --git a/tool/gen_docs.dart b/tool/gen_docs.dart index bbbbaef..7a33107 100644 --- a/tool/gen_docs.dart +++ b/tool/gen_docs.dart @@ -90,14 +90,8 @@ String _createRuleTable( final ruleMeta = lintMeta.firstWhereOrNull((meta) => meta['name'] == rule); - if (ruleMeta == null) { - print('rules.json data for rule \'$rule\' not found.'); - print('Update lib/rules.json from ' - 'https://raw.githubusercontent.com/dart-lang/site-www/main/src/_data/linter_rules.json.'); - exit(1); - } - final description = ruleMeta['description'] as String?; - final hasFix = ruleMeta['fixStatus'] == 'hasFix'; + final description = ruleMeta?['description'] as String? ?? ''; + final hasFix = ruleMeta?['fixStatus'] == 'hasFix'; final fixDesc = hasFix ? '✅' : ''; return '| [`$rule`](https://dart.dev/lints/$rule) | $description | $fixDesc |'; diff --git a/tool/rules.json b/tool/rules.json index a055005..fdf9ec9 100644 --- a/tool/rules.json +++ b/tool/rules.json @@ -27,7 +27,7 @@ { "name": "avoid_returning_null_for_future", "description": "Avoid returning null for Future.", - "fixStatus": "hasFix" + "fixStatus": "noFix" }, { "name": "avoid_slow_async_io", @@ -72,7 +72,7 @@ { "name": "comment_references", "description": "Only reference in scope identifiers in doc comments.", - "fixStatus": "noFix" + "fixStatus": "hasFix" }, { "name": "control_flow_in_finally", @@ -82,7 +82,7 @@ { "name": "deprecated_member_use_from_same_package", "description": "Avoid using deprecated elements from within the package in which they are declared.", - "fixStatus": "needsFix" + "fixStatus": "hasFix" }, { "name": "diagnostic_describe_all_properties", @@ -134,6 +134,11 @@ "description": "Boolean expression composed only with literals.", "fixStatus": "noFix" }, + { + "name": "missing_code_block_language_in_doc_comment", + "description": "A code block is missing a specified language.", + "fixStatus": "needsEvaluation" + }, { "name": "no_adjacent_strings_in_list", "description": "Don't use adjacent strings in list.", @@ -179,6 +184,11 @@ "description": "Avoid `throw` in finally block.", "fixStatus": "noFix" }, + { + "name": "unintended_html_in_doc_comment", + "description": "Use of angle brackets in a doc comment is treated as HTML by Markdown.", + "fixStatus": "needsEvaluation" + }, { "name": "unnecessary_statements", "description": "Avoid using unnecessary statements.", @@ -247,7 +257,7 @@ { "name": "always_require_non_null_named_parameters", "description": "Specify `@required` on named parameters without defaults.", - "fixStatus": "hasFix" + "fixStatus": "noFix" }, { "name": "always_specify_types", @@ -522,7 +532,7 @@ { "name": "flutter_style_todos", "description": "Use Flutter TODO format: // TODO(username): message, https://URL-to-issue.", - "fixStatus": "noFix" + "fixStatus": "hasFix" }, { "name": "implementation_imports", @@ -871,7 +881,7 @@ }, { "name": "require_trailing_commas", - "description": "Use trailing commas for all function calls and declarations.", + "description": "Use trailing commas for all parameter lists and argument lists.", "fixStatus": "hasFix" }, { @@ -984,6 +994,11 @@ "description": "Avoid library directives unless they have documentation comments or annotations.", "fixStatus": "hasFix" }, + { + "name": "unnecessary_library_name", + "description": "Don't have a library name in a `library` declaration.", + "fixStatus": "hasFix" + }, { "name": "unnecessary_new", "description": "Unnecessary new keyword.", From 1cd93f4ce779f373216ee80389e52c0bf9c0d079 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 1 May 2024 10:19:36 +0000 Subject: [PATCH 10/12] Bump actions/checkout from 4.1.2 to 4.1.4 (#186) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Bumps [actions/checkout](https://github.com/actions/checkout) from 4.1.2 to 4.1.4.
Release notes

Sourced from actions/checkout's releases.

v4.1.4

What's Changed

Full Changelog: https://github.com/actions/checkout/compare/v4.1.3...v4.1.4

v4.1.3

What's Changed

Full Changelog: https://github.com/actions/checkout/compare/v4.1.2...v4.1.3

Changelog

Sourced from actions/checkout's changelog.

Changelog

v4.1.4

v4.1.3

v4.1.2

v4.1.1

v4.1.0

v4.0.0

v3.6.0

v3.5.3

v3.5.2

v3.5.1

v3.5.0

v3.4.0

... (truncated)

Commits

[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=actions/checkout&package-manager=github_actions&previous-version=4.1.2&new-version=4.1.4)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. ---
Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot show ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
--- .github/workflows/validate.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/validate.yml b/.github/workflows/validate.yml index f26245e..12a46db 100644 --- a/.github/workflows/validate.yml +++ b/.github/workflows/validate.yml @@ -20,7 +20,7 @@ jobs: sdk: [3.1, stable, beta] steps: - - uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 + - uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b - uses: dart-lang/setup-dart@fedb1266e91cf51be2fdb382869461a434b920a3 with: sdk: ${{ matrix.sdk }} From e467d1e6cfc9b3d3f90f1d49e078c65a2ed28539 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 1 May 2024 15:29:38 +0000 Subject: [PATCH 11/12] Bump dart-lang/setup-dart from 1.6.2 to 1.6.4 (#185) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Bumps [dart-lang/setup-dart](https://github.com/dart-lang/setup-dart) from 1.6.2 to 1.6.4.
Release notes

Sourced from dart-lang/setup-dart's releases.

v1.6.4

  • Rebuild JS code to include changes from v1.6.3

v1.6.3

Changelog

Sourced from dart-lang/setup-dart's changelog.

v1.6.4

  • Rebuild JS code.

v1.6.3

v1.6.2

v1.6.1

  • Updated the google storage url for main channel releases.

v1.6.0

  • Enable provisioning of the latest Dart SDK patch release by specifying just the major and minor version (e.g. 3.2).

v1.5.1

  • No longer test the setup-dart action on pre-2.12 SDKs.
  • Upgrade JS interop code to use extension types (the new name for inline classes).
  • The upcoming rename of the be channel to main is now supported with forward compatibility that switches when the rename happens.

v1.5.0

  • Re-wrote the implementation of the action into Dart.
  • Auto-detect the platform architecture (x64, ia32, arm, arm64).
  • Improved the caching and download resilience of the sdk.
  • Added a new action output: dart-version - the installed version of the sdk.

v1.4.0

  • Automatically create OIDC token for pub.dev.
  • Add a reusable workflow for publishing.

v1.3.0

  • The install location of the Dart SDK is now available

... (truncated)

Commits

[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=dart-lang/setup-dart&package-manager=github_actions&previous-version=1.6.2&new-version=1.6.4)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. ---
Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot show ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
--- .github/workflows/validate.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/validate.yml b/.github/workflows/validate.yml index 12a46db..bc822c0 100644 --- a/.github/workflows/validate.yml +++ b/.github/workflows/validate.yml @@ -21,7 +21,7 @@ jobs: steps: - uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b - - uses: dart-lang/setup-dart@fedb1266e91cf51be2fdb382869461a434b920a3 + - uses: dart-lang/setup-dart@f0ead981b4d9a35b37f30d36160575d60931ec30 with: sdk: ${{ matrix.sdk }} From f0205c181066f16485a70fa2b242b9208475856f Mon Sep 17 00:00:00 2001 From: Devon Carew Date: Thu, 9 May 2024 09:31:36 -0700 Subject: [PATCH 12/12] rev to 4.0.0; prep to publish (#184) --- CHANGELOG.md | 2 +- pubspec.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ec395c5..5950671 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,4 @@ -## 4.0.0-wip +## 4.0.0 - `core`: - added `library_annotations` (https://github.com/dart-lang/lints/issues/177) diff --git a/pubspec.yaml b/pubspec.yaml index 6c02d5b..66f7a8a 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,5 +1,5 @@ name: lints -version: 4.0.0-wip +version: 4.0.0 description: > Official Dart lint rules. Defines the 'core' and 'recommended' set of lints suggested by the Dart team.