[L] Change in dart/sdk[main]: Add new unnecessary_type_name_in_constructor lint

0 views
Skip to first unread message

Brian Wilkerson (Gerrit)

unread,
Apr 21, 2026, 4:08:08 PM (19 hours ago) Apr 21
to Brian Wilkerson, Keerti Parthasarathy, Connie Ooi, dart-...@luci-project-accounts.iam.gserviceaccount.com, dart-analys...@google.com, rev...@dartlang.org
Attention needed from Connie Ooi and Keerti Parthasarathy

New activity on the change

Open in Gerrit

Related details

Attention is currently required from:
  • Connie Ooi
  • 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: Ib6bc46b4455c360732553eadea3451d7dfb874a6
Gerrit-Change-Number: 497120
Gerrit-PatchSet: 3
Gerrit-Owner: Brian Wilkerson <brianwi...@google.com>
Gerrit-Reviewer: Brian Wilkerson <brianwi...@google.com>
Gerrit-Reviewer: Connie Ooi <conn...@google.com>
Gerrit-Reviewer: Keerti Parthasarathy <kee...@google.com>
Gerrit-Attention: Connie Ooi <conn...@google.com>
Gerrit-Attention: Keerti Parthasarathy <kee...@google.com>
Gerrit-Comment-Date: Tue, 21 Apr 2026 20:08:06 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Keerti Parthasarathy (Gerrit)

unread,
Apr 21, 2026, 4:59:57 PM (18 hours ago) Apr 21
to Brian Wilkerson, Connie Ooi, dart-...@luci-project-accounts.iam.gserviceaccount.com, dart-analys...@google.com, rev...@dartlang.org
Attention needed from Brian Wilkerson and Connie Ooi

Keerti Parthasarathy added 2 comments

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

Nice!

File pkg/linter/test/rules/unnecessary_type_name_in_constructor_test.dart
Line 16, Patchset 3 (Latest):class UnnecessaryConstInEnumConstructorTest extends LintRuleTest {
Keerti Parthasarathy . unresolved

nit: rename to `UnnecessaryTypeNameInConstructorTest`

Open in Gerrit

Related details

Attention is currently required from:
  • Brian Wilkerson
  • Connie Ooi
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: Ib6bc46b4455c360732553eadea3451d7dfb874a6
Gerrit-Change-Number: 497120
Gerrit-PatchSet: 3
Gerrit-Owner: Brian Wilkerson <brianwi...@google.com>
Gerrit-Reviewer: Brian Wilkerson <brianwi...@google.com>
Gerrit-Reviewer: Connie Ooi <conn...@google.com>
Gerrit-Reviewer: Keerti Parthasarathy <kee...@google.com>
Gerrit-Attention: Brian Wilkerson <brianwi...@google.com>
Gerrit-Attention: Connie Ooi <conn...@google.com>
Gerrit-Comment-Date: Tue, 21 Apr 2026 20:59:54 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Keerti Parthasarathy (Gerrit)

unread,
Apr 21, 2026, 4:59:59 PM (18 hours ago) Apr 21
to Brian Wilkerson, Connie Ooi, dart-...@luci-project-accounts.iam.gserviceaccount.com, dart-analys...@google.com, rev...@dartlang.org
Attention needed from Brian Wilkerson and Connie Ooi

Keerti Parthasarathy voted Code-Review+1

Code-Review+1
Open in Gerrit

Related details

Attention is currently required from:
  • Brian Wilkerson
  • Connie Ooi
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: Ib6bc46b4455c360732553eadea3451d7dfb874a6
Gerrit-Change-Number: 497120
Gerrit-PatchSet: 3
Gerrit-Owner: Brian Wilkerson <brianwi...@google.com>
Gerrit-Reviewer: Brian Wilkerson <brianwi...@google.com>
Gerrit-Reviewer: Connie Ooi <conn...@google.com>
Gerrit-Reviewer: Keerti Parthasarathy <kee...@google.com>
Gerrit-Attention: Brian Wilkerson <brianwi...@google.com>
Gerrit-Attention: Connie Ooi <conn...@google.com>
Gerrit-Comment-Date: Tue, 21 Apr 2026 20:59:57 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
satisfied_requirement
open
diffy

Brian Wilkerson (Gerrit)

unread,
Apr 21, 2026, 5:43:38 PM (18 hours ago) Apr 21
to Brian Wilkerson, Keerti Parthasarathy, Connie Ooi, dart-...@luci-project-accounts.iam.gserviceaccount.com, dart-analys...@google.com, rev...@dartlang.org
Attention needed from Connie Ooi

Brian Wilkerson voted and added 2 comments

Votes added by Brian Wilkerson

Commit-Queue+2

2 comments

Patchset-level comments
File-level comment, Patchset 4 (Latest):
Brian Wilkerson . resolved

Connie: I'll update the docs when you've had a chance to look at them.

File pkg/linter/test/rules/unnecessary_type_name_in_constructor_test.dart
Line 16, Patchset 3:class UnnecessaryConstInEnumConstructorTest extends LintRuleTest {
Keerti Parthasarathy . resolved

nit: rename to `UnnecessaryTypeNameInConstructorTest`

Brian Wilkerson

Done

Open in Gerrit

Related details

Attention is currently required from:
  • Connie Ooi
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: Ib6bc46b4455c360732553eadea3451d7dfb874a6
Gerrit-Change-Number: 497120
Gerrit-PatchSet: 4
Gerrit-Owner: Brian Wilkerson <brianwi...@google.com>
Gerrit-Reviewer: Brian Wilkerson <brianwi...@google.com>
Gerrit-Reviewer: Connie Ooi <conn...@google.com>
Gerrit-Reviewer: Keerti Parthasarathy <kee...@google.com>
Gerrit-Attention: Connie Ooi <conn...@google.com>
Gerrit-Comment-Date: Tue, 21 Apr 2026 21:43:36 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Comment-In-Reply-To: Keerti Parthasarathy <kee...@google.com>
satisfied_requirement
open
diffy

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

unread,
Apr 21, 2026, 6:12:39 PM (17 hours ago) Apr 21
to Brian Wilkerson, Keerti Parthasarathy, Connie Ooi, dart-analys...@google.com, rev...@dartlang.org

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

Unreviewed changes

3 is the latest approved patch-set.
The change was submitted with unreviewed changes in the following files:

```
The name of the file: pkg/linter/test/rules/unnecessary_type_name_in_constructor_test.dart
Insertions: 2, Deletions: 2.

@@ -8,12 +8,12 @@

void main() {
defineReflectiveSuite(() {
- defineReflectiveTests(UnnecessaryConstInEnumConstructorTest);
+ defineReflectiveTests(UnnecessaryTypeNameInConstructorTest);
});
}

@reflectiveTest
-class UnnecessaryConstInEnumConstructorTest extends LintRuleTest {
+class UnnecessaryTypeNameInConstructorTest extends LintRuleTest {
@override
String get lintRule => LintNames.unnecessary_type_name_in_constructor;

```

Change information

Commit message:
Add new unnecessary_type_name_in_constructor lint

This adds a new lint to recommend removing the type name from secondary
constructors.

It also adds a new fix that can automate the removal.
Change-Id: Ib6bc46b4455c360732553eadea3451d7dfb874a6
Commit-Queue: Brian Wilkerson <brianwi...@google.com>
Reviewed-by: Keerti Parthasarathy <kee...@google.com>
Files:
  • A pkg/analysis_server/lib/src/services/correction/dart/remove_type_name.dart
  • M pkg/analysis_server/lib/src/services/correction/error_fix_status.yaml
  • M pkg/analysis_server/lib/src/services/correction/fix.dart
  • M pkg/analysis_server/lib/src/services/correction/fix_internal.dart
  • A pkg/analysis_server/test/src/services/correction/fix/remove_type_name_test.dart
  • M pkg/analysis_server/test/src/services/correction/fix/test_all.dart
  • M pkg/linter/example/all.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_type_name_in_constructor.dart
  • M pkg/linter/messages.yaml
  • M pkg/linter/test/rules/all.dart
  • A pkg/linter/test/rules/unnecessary_type_name_in_constructor_test.dart
Change size: L
Delta: 14 files changed, 400 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: Ib6bc46b4455c360732553eadea3451d7dfb874a6
Gerrit-Change-Number: 497120
Gerrit-PatchSet: 5
Gerrit-Owner: Brian Wilkerson <brianwi...@google.com>
Gerrit-Reviewer: Brian Wilkerson <brianwi...@google.com>
Gerrit-Reviewer: Connie Ooi <conn...@google.com>
Gerrit-Reviewer: Keerti Parthasarathy <kee...@google.com>
open
diffy
satisfied_requirement
Reply all
Reply to author
Forward
0 new messages