Skip to content

team lints: update to latest pkg:lints #359

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 28, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/dart_flutter_team_lints.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
strategy:
fail-fast: false
matrix:
sdk: [dev] # TODO: add back in stable
sdk: [3.8, dev]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks!

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps:

Suggested change
sdk: [3.8, dev]
sdk: [3.8, stable, dev]

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I mean, we could. I've never seen a bug that shows up in a middle build...

steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
- uses: dart-lang/setup-dart@e51d8e571e22473a2ddebf0ef8a2123f0ab2c02c
Expand All @@ -38,6 +38,6 @@ jobs:
- run: dart analyze --fatal-infos

- run: dart format --output=none --set-exit-if-changed .
if: ${{ matrix.sdk == 'stable' }}
if: ${{ matrix.sdk == 'dev' }}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's wrong w/ 'stable' here (for verifying formatting)?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because developers generally use dev builds. Less likely to fight formatting deltas.


- run: dart test
5 changes: 5 additions & 0 deletions pkgs/dart_flutter_team_lints/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## 3.5.2

- Depend on the `6.0.0` release of `package:lints`.
- Require Dart `3.8`

## 3.5.1

- Removed `discarded_futures`; this produced more results than expected.
Expand Down
2 changes: 0 additions & 2 deletions pkgs/dart_flutter_team_lints/lib/analysis_options.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,8 @@ linter:
- comment_references
- conditional_uri_does_not_exist
- only_throw_errors
- strict_top_level_inference
- test_types_in_equals
- throw_in_finally
- type_annotate_public_apis
- unawaited_futures
- unnecessary_underscores
- unreachable_from_main
8 changes: 4 additions & 4 deletions pkgs/dart_flutter_team_lints/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
name: dart_flutter_team_lints
description: An analysis rule set used by the Dart and Flutter teams.
version: 3.5.1
version: 3.5.2
repository: https://github.com/dart-lang/ecosystem/tree/main/pkgs/dart_flutter_team_lints
issue_tracker: https://github.com/dart-lang/ecosystem/issues?q=is%3Aissue+is%3Aopen+label%3Apackage%3Adart_flutter_team_lints

environment:
sdk: ^3.7.0
sdk: ^3.8.0

dependencies:
lints: ^5.0.0
lints: ^6.0.0

dev_dependencies:
checks: ^0.3.0
path: ^1.8.0
test: ^1.0.0
test: ^1.24.0
yaml: ^3.0.0
16 changes: 7 additions & 9 deletions pkgs/dart_flutter_team_lints/tool/dedup.dart
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,9 @@ Map<String, Directory>? _findPackageConfig(Directory dir) {
return null;
}

final configFile =
File(path.join(dir.path, '.dart_tool', 'package_config.json'));
final configFile = File(
path.join(dir.path, '.dart_tool', 'package_config.json'),
);
if (configFile.existsSync()) {
return _parseConfigFile(configFile);
} else {
Expand Down Expand Up @@ -122,8 +123,9 @@ class Lints {
final lints = (yaml['linter'] as YamlMap?)?['rules'] as YamlList;

return Lints._(
parent:
localInclude == null ? null : Lints.readFrom(localInclude, packages),
parent: localInclude == null
? null
: Lints.readFrom(localInclude, packages),
include: include,
lints: lints.cast<String>().toList(),
);
Expand All @@ -133,11 +135,7 @@ class Lints {
final String include;
final List<String> lints;

Lints._({
this.parent,
required this.include,
required this.lints,
});
Lints._({this.parent, required this.include, required this.lints});

Lints? containingInclude(String lint) {
if (lints.contains(lint)) return this;
Expand Down