Skip to content
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

New rule: Use matching super parameter names #4263

Merged
merged 4 commits into from
Apr 17, 2023
Merged

New rule: Use matching super parameter names #4263

merged 4 commits into from
Apr 17, 2023

Conversation

srawlins
Copy link
Member

@srawlins srawlins commented Apr 7, 2023

Implements the proposal at #4259

@coveralls
Copy link

coveralls commented Apr 7, 2023

Coverage Status

Coverage: 96.421% (+0.004%) from 96.416% when pulling 556e758 on super-name-name into fffb74c on main.

@pq
Copy link
Member

pq commented Apr 7, 2023

I'd like to get a little more conversation on the proposal (#4259) before landing.

@srawlins
Copy link
Member Author

srawlins commented Apr 7, 2023

Sounds good. Anything specific?

@pq
Copy link
Member

pq commented Apr 7, 2023

As per https://github.com/dart-lang/linter/blob/main/doc/lint-lifecycle.md we generally try and get a bunch of input before "accepting" a proposed lint. I'll go ahead and cc some folks who are reliably opinionated.


@override
void visitConstructorDeclaration(ConstructorDeclaration node) {
var positionalSuperParameters = node.parameters.parameters
Copy link
Member

Choose a reason for hiding this comment

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

I'd be inclined to do this less idiomatically in preference of just one iteration and without all the temporary objects. (I did a series of changes that dumbed down code like this and made it measurably faster.)

Copy link
Member

Choose a reason for hiding this comment

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

I mean, parameter lists are short but I guess I think every bit counts. 🤔

Copy link
Member

Choose a reason for hiding this comment

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

FWIW, here's an extreme motivating example: #1838

Copy link
Member Author

Choose a reason for hiding this comment

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

Done

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants