[M] Change in dart/sdk[main]: Add an unnecessary_primary_constructor_body lint

0 views
Skip to first unread message

Brian Wilkerson (Gerrit)

unread,
Jun 9, 2026, 1:33:03 PM (2 days ago) Jun 9
to Brian Wilkerson, Keerti Parthasarathy, dart-...@luci-project-accounts.iam.gserviceaccount.com, dart-analys...@google.com, rev...@dartlang.org
Attention needed from Keerti Parthasarathy

Brian Wilkerson voted Commit-Queue+1

Commit-Queue+1
Open in Gerrit

Related details

Attention is currently required from:
  • Keerti Parthasarathy
Submit Requirements:
  • requirement satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: sdk
Gerrit-Branch: main
Gerrit-Change-Id: Ia5ffa6b06c75a6a7400ec32a9d22209c08a9c73d
Gerrit-Change-Number: 510401
Gerrit-PatchSet: 1
Gerrit-Owner: Brian Wilkerson <brianwi...@google.com>
Gerrit-Reviewer: Brian Wilkerson <brianwi...@google.com>
Gerrit-Reviewer: Keerti Parthasarathy <kee...@google.com>
Gerrit-Attention: Keerti Parthasarathy <kee...@google.com>
Gerrit-Comment-Date: Tue, 09 Jun 2026 17:32:59 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
satisfied_requirement
unsatisfied_requirement
open
diffy

Keerti Parthasarathy (Gerrit)

unread,
Jun 9, 2026, 2:33:45 PM (2 days ago) Jun 9
to Brian Wilkerson, dart-...@luci-project-accounts.iam.gserviceaccount.com, dart-analys...@google.com, rev...@dartlang.org
Attention needed from Brian Wilkerson

Keerti Parthasarathy added 1 comment

Patchset-level comments
File-level comment, Patchset 1 (Latest):
Keerti Parthasarathy . resolved

Looks good, lint makes sense to me.

Open in Gerrit

Related details

Attention is currently required from:
  • Brian Wilkerson
Submit Requirements:
  • requirement satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: sdk
Gerrit-Branch: main
Gerrit-Change-Id: Ia5ffa6b06c75a6a7400ec32a9d22209c08a9c73d
Gerrit-Change-Number: 510401
Gerrit-PatchSet: 1
Gerrit-Owner: Brian Wilkerson <brianwi...@google.com>
Gerrit-Reviewer: Brian Wilkerson <brianwi...@google.com>
Gerrit-Reviewer: Keerti Parthasarathy <kee...@google.com>
Gerrit-Attention: Brian Wilkerson <brianwi...@google.com>
Gerrit-Comment-Date: Tue, 09 Jun 2026 18:33:41 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Keerti Parthasarathy (Gerrit)

unread,
Jun 9, 2026, 2:33:56 PM (2 days ago) Jun 9
to Brian Wilkerson, dart-...@luci-project-accounts.iam.gserviceaccount.com, dart-analys...@google.com, rev...@dartlang.org
Attention needed from Brian Wilkerson

Keerti Parthasarathy voted Code-Review+1

Code-Review+1
Open in Gerrit

Related details

Attention is currently required from:
  • Brian Wilkerson
Submit Requirements:
  • requirement satisfiedCode-Owners
  • requirement satisfiedCode-Review
  • requirement satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: sdk
Gerrit-Branch: main
Gerrit-Change-Id: Ia5ffa6b06c75a6a7400ec32a9d22209c08a9c73d
Gerrit-Change-Number: 510401
Gerrit-PatchSet: 1
Gerrit-Owner: Brian Wilkerson <brianwi...@google.com>
Gerrit-Reviewer: Brian Wilkerson <brianwi...@google.com>
Gerrit-Reviewer: Keerti Parthasarathy <kee...@google.com>
Gerrit-Attention: Brian Wilkerson <brianwi...@google.com>
Gerrit-Comment-Date: Tue, 09 Jun 2026 18:33:48 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
satisfied_requirement
open
diffy

Brian Wilkerson (Gerrit)

unread,
Jun 9, 2026, 2:38:54 PM (2 days ago) Jun 9
to Brian Wilkerson, Keerti Parthasarathy, dart-...@luci-project-accounts.iam.gserviceaccount.com, dart-analys...@google.com, rev...@dartlang.org

Brian Wilkerson voted Commit-Queue+2

Commit-Queue+2
Open in Gerrit

Related details

Attention set is empty
Submit Requirements:
  • requirement satisfiedCode-Owners
  • requirement satisfiedCode-Review
  • requirement satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: sdk
Gerrit-Branch: main
Gerrit-Change-Id: Ia5ffa6b06c75a6a7400ec32a9d22209c08a9c73d
Gerrit-Change-Number: 510401
Gerrit-PatchSet: 1
Gerrit-Owner: Brian Wilkerson <brianwi...@google.com>
Gerrit-Reviewer: Brian Wilkerson <brianwi...@google.com>
Gerrit-Reviewer: Keerti Parthasarathy <kee...@google.com>
Gerrit-Comment-Date: Tue, 09 Jun 2026 18:38:50 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
satisfied_requirement
open
diffy

dart-scoped@luci-project-accounts.iam.gserviceaccount.com (Gerrit)

unread,
Jun 9, 2026, 2:39:08 PM (2 days ago) Jun 9
to Brian Wilkerson, Keerti Parthasarathy, dart-analys...@google.com, rev...@dartlang.org

dart-...@luci-project-accounts.iam.gserviceaccount.com submitted the change

Change information

Commit message:
Add an unnecessary_primary_constructor_body lint

The lint will fire even when there is a comment in the body, such as
```dart
class C() {
this { /* comment */ }
}
```

I think this is the right behavior because I can't think of any useful
comment that wouldn't be better somewhere else, but let me know if you
disagree.

This doesn't yet have a fix, but it should.
Change-Id: Ia5ffa6b06c75a6a7400ec32a9d22209c08a9c73d
Reviewed-by: Keerti Parthasarathy <kee...@google.com>
Commit-Queue: Brian Wilkerson <brianwi...@google.com>
Files:
  • M pkg/analysis_server/lib/src/services/correction/error_fix_status.yaml
  • M pkg/linter/lib/src/diagnostic.g.dart
  • M pkg/linter/lib/src/lint_names.g.dart
  • M pkg/linter/lib/src/rules.dart
  • A pkg/linter/lib/src/rules/unnecessary_primary_constructor_body.dart
  • M pkg/linter/messages.yaml
  • M pkg/linter/test/rules/all.dart
  • A pkg/linter/test/rules/unnecessary_primary_constructor_body_test.dart
Change size: M
Delta: 8 files changed, 173 insertions(+), 0 deletions(-)
Branch: refs/heads/main
Submit Requirements:
  • requirement satisfiedCode-Review: +1 by Keerti Parthasarathy
Open in Gerrit
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: merged
Gerrit-Project: sdk
Gerrit-Branch: main
Gerrit-Change-Id: Ia5ffa6b06c75a6a7400ec32a9d22209c08a9c73d
Gerrit-Change-Number: 510401
Gerrit-PatchSet: 2
Gerrit-Owner: Brian Wilkerson <brianwi...@google.com>
Gerrit-Reviewer: Brian Wilkerson <brianwi...@google.com>
Gerrit-Reviewer: Keerti Parthasarathy <kee...@google.com>
open
diffy
satisfied_requirement
Reply all
Reply to author
Forward
0 new messages