[S] Change in dart/sdk[main]: [DAS] Fixes false-positive on comment references for `unnecessary_und...

0 views
Skip to first unread message

Felipe Morschel (Gerrit)

unread,
Nov 27, 2025, 6:48:18 AM (2 days ago) Nov 27
to dart-analys...@google.com, rev...@dartlang.org

Felipe Morschel has uploaded the change for review

Commit message

[DAS] Fixes false-positive on comment references for `unnecessary_underscores`
Change-Id: I813e4390521c31660776b12c6cd0792f779ff675

Change information

Files:
  • M pkg/linter/lib/src/rules/unnecessary_underscores.dart
  • M pkg/linter/test/rules/unnecessary_underscores_test.dart
Change size: S
Delta: 2 files changed, 23 insertions(+), 1 deletion(-)
Open in Gerrit

Related details

Attention set is empty
Submit Requirements:
  • requirement is not 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: newchange
Gerrit-Project: sdk
Gerrit-Branch: main
Gerrit-Change-Id: I813e4390521c31660776b12c6cd0792f779ff675
Gerrit-Change-Number: 464627
Gerrit-PatchSet: 1
Gerrit-Owner: Felipe Morschel <g...@fmorschel.dev>
Gerrit-Reviewer: Felipe Morschel <g...@fmorschel.dev>
unsatisfied_requirement
open
diffy

Rohit Saily (Gerrit)

unread,
Nov 27, 2025, 7:01:26 AM (2 days ago) Nov 27
to Felipe Morschel, Brian Wilkerson, Samuel Rawlins, dart-analys...@google.com, rev...@dartlang.org
Attention needed from Brian Wilkerson, Felipe Morschel and Samuel Rawlins

Rohit Saily added 1 comment

Patchset-level comments
File-level comment, Patchset 1 (Latest):
Rohit Saily . resolved

Code looks good. For my own understanding - do we know why `referencedElements` was declared `late`?

Open in Gerrit

Related details

Attention is currently required from:
  • Brian Wilkerson
  • Felipe Morschel
  • Samuel Rawlins
Submit Requirements:
  • requirement is not 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: I813e4390521c31660776b12c6cd0792f779ff675
Gerrit-Change-Number: 464627
Gerrit-PatchSet: 1
Gerrit-Owner: Felipe Morschel <g...@fmorschel.dev>
Gerrit-Reviewer: Brian Wilkerson <brianwi...@google.com>
Gerrit-Reviewer: Felipe Morschel <g...@fmorschel.dev>
Gerrit-Reviewer: Samuel Rawlins <sraw...@google.com>
Gerrit-CC: Rohit Saily <he...@rohitsaily.com>
Gerrit-Attention: Brian Wilkerson <brianwi...@google.com>
Gerrit-Attention: Felipe Morschel <g...@fmorschel.dev>
Gerrit-Attention: Samuel Rawlins <sraw...@google.com>
Gerrit-Comment-Date: Thu, 27 Nov 2025 12:01:22 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
unsatisfied_requirement
open
diffy

Felipe Morschel (Gerrit)

unread,
Nov 27, 2025, 7:05:16 AM (2 days ago) Nov 27
to Rohit Saily, Brian Wilkerson, Samuel Rawlins, dart-analys...@google.com, rev...@dartlang.org
Attention needed from Brian Wilkerson, Rohit Saily and Samuel Rawlins

Felipe Morschel added 1 comment

Patchset-level comments
Rohit Saily . resolved

Code looks good. For my own understanding - do we know why `referencedElements` was declared `late`?

Felipe Morschel

Because if we never get to the point where a parameter name `isJustUnderscores`, we don't initialize the variable. This way we avoid doing the computation for all referenced names and we don't have to use `collectReferences` multiple times inside the loop (every time another parameter name `isJustUnderscores`).

Open in Gerrit

Related details

Attention is currently required from:
  • Brian Wilkerson
  • Rohit Saily
  • Samuel Rawlins
Submit Requirements:
  • requirement is not 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: I813e4390521c31660776b12c6cd0792f779ff675
Gerrit-Change-Number: 464627
Gerrit-PatchSet: 1
Gerrit-Owner: Felipe Morschel <g...@fmorschel.dev>
Gerrit-Reviewer: Brian Wilkerson <brianwi...@google.com>
Gerrit-Reviewer: Felipe Morschel <g...@fmorschel.dev>
Gerrit-Reviewer: Samuel Rawlins <sraw...@google.com>
Gerrit-CC: Rohit Saily <he...@rohitsaily.com>
Gerrit-Attention: Brian Wilkerson <brianwi...@google.com>
Gerrit-Attention: Rohit Saily <he...@rohitsaily.com>
Gerrit-Attention: Samuel Rawlins <sraw...@google.com>
Gerrit-Comment-Date: Thu, 27 Nov 2025 12:05:13 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Rohit Saily <he...@rohitsaily.com>
unsatisfied_requirement
open
diffy

Rohit Saily (Gerrit)

unread,
Nov 27, 2025, 7:18:12 AM (2 days ago) Nov 27
to Felipe Morschel, Brian Wilkerson, Samuel Rawlins, dart-analys...@google.com, rev...@dartlang.org
Attention needed from Brian Wilkerson, Felipe Morschel and Samuel Rawlins

Rohit Saily added 1 comment

Patchset-level comments
Rohit Saily . resolved

Code looks good. For my own understanding - do we know why `referencedElements` was declared `late`?

Felipe Morschel

Because if we never get to the point where a parameter name `isJustUnderscores`, we don't initialize the variable. This way we avoid doing the computation for all referenced names and we don't have to use `collectReferences` multiple times inside the loop (every time another parameter name `isJustUnderscores`).

Rohit Saily

The makes sense, thanks. That's a useful strategy for avoiding excess computation - I'm going to try to apply that when I code

Open in Gerrit

Related details

Attention is currently required from:
  • Brian Wilkerson
  • Felipe Morschel
  • Samuel Rawlins
Submit Requirements:
  • requirement is not 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: I813e4390521c31660776b12c6cd0792f779ff675
Gerrit-Change-Number: 464627
Gerrit-PatchSet: 1
Gerrit-Owner: Felipe Morschel <g...@fmorschel.dev>
Gerrit-Reviewer: Brian Wilkerson <brianwi...@google.com>
Gerrit-Reviewer: Felipe Morschel <g...@fmorschel.dev>
Gerrit-Reviewer: Samuel Rawlins <sraw...@google.com>
Gerrit-CC: Rohit Saily <he...@rohitsaily.com>
Gerrit-Attention: Brian Wilkerson <brianwi...@google.com>
Gerrit-Attention: Felipe Morschel <g...@fmorschel.dev>
Gerrit-Attention: Samuel Rawlins <sraw...@google.com>
Gerrit-Comment-Date: Thu, 27 Nov 2025 12:18:09 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Felipe Morschel <g...@fmorschel.dev>
Comment-In-Reply-To: Rohit Saily <he...@rohitsaily.com>
unsatisfied_requirement
open
diffy

Samuel Rawlins (Gerrit)

unread,
Nov 27, 2025, 1:27:55 PM (2 days ago) Nov 27
to Felipe Morschel, Rohit Saily, Brian Wilkerson, dart-analys...@google.com, rev...@dartlang.org
Attention needed from Brian Wilkerson and Felipe Morschel

Samuel Rawlins voted Code-Review+1

Code-Review+1
Open in Gerrit

Related details

Attention is currently required from:
  • Brian Wilkerson
  • Felipe Morschel
Submit Requirements:
  • requirement satisfiedCode-Owners
  • requirement 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: I813e4390521c31660776b12c6cd0792f779ff675
Gerrit-Change-Number: 464627
Gerrit-PatchSet: 1
Gerrit-Owner: Felipe Morschel <g...@fmorschel.dev>
Gerrit-Reviewer: Brian Wilkerson <brianwi...@google.com>
Gerrit-Reviewer: Felipe Morschel <g...@fmorschel.dev>
Gerrit-Reviewer: Samuel Rawlins <sraw...@google.com>
Gerrit-CC: Rohit Saily <he...@rohitsaily.com>
Gerrit-Attention: Brian Wilkerson <brianwi...@google.com>
Gerrit-Attention: Felipe Morschel <g...@fmorschel.dev>
Gerrit-Comment-Date: Thu, 27 Nov 2025 18:27:52 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
satisfied_requirement
unsatisfied_requirement
open
diffy
Reply all
Reply to author
Forward
0 new messages