Skip to content

Migrate avoid_late_keyword rule (default behavior) and tests#231

Merged
andrew-bekhiet-solid merged 4 commits into
analysis_server_migrationfrom
migrate/avoid_late_keyword
Jun 26, 2026
Merged

Migrate avoid_late_keyword rule (default behavior) and tests#231
andrew-bekhiet-solid merged 4 commits into
analysis_server_migrationfrom
migrate/avoid_late_keyword

Conversation

@Islam-Shaaban-Ibrahim

Copy link
Copy Markdown

No description provided.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Code Review

This pull request migrates the AvoidLateKeywordRule to the AnalysisRule framework, introducing a dedicated visitor and unit tests. The review highlights a regression where configuration parameters for ignoring types and allowing initializers were removed, and notes a missing import in the visitor class that will cause a compilation error.

Comment thread lib/src/lints/avoid_late_keyword/avoid_late_keyword_rule.dart Outdated
@solid-vovabeloded

Copy link
Copy Markdown
Collaborator

@Islam-Shaaban-Ibrahim, I believe this rule needs custom params to allow users to configure it.

@andrew-bekhiet-solid andrew-bekhiet-solid force-pushed the migrate/avoid_late_keyword branch from 0f69812 to 730d708 Compare June 3, 2026 23:15
@andrew-bekhiet-solid andrew-bekhiet-solid changed the base branch from analysis_server_migration to implementation-of-parameter-parser June 3, 2026 23:15
@andrew-bekhiet-solid andrew-bekhiet-solid marked this pull request as draft June 3, 2026 23:16

@danylo-safonov-solid danylo-safonov-solid left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

lgtm

@andrew-bekhiet-solid andrew-bekhiet-solid linked an issue Jun 9, 2026 that may be closed by this pull request
@andrew-bekhiet-solid andrew-bekhiet-solid force-pushed the implementation-of-parameter-parser branch from d51e1bf to 0975ba7 Compare June 10, 2026 14:34
@andrew-bekhiet-solid andrew-bekhiet-solid force-pushed the migrate/avoid_late_keyword branch from 730d708 to 6092317 Compare June 10, 2026 14:49
Base automatically changed from implementation-of-parameter-parser to analysis_server_migration June 10, 2026 16:30
@andrew-bekhiet-solid andrew-bekhiet-solid marked this pull request as ready for review June 10, 2026 22:10

@solid-danylosafonov solid-danylosafonov left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

looks like it needs to be rebased?

Comment thread lib/main.dart
registry.registerLintRule(
final analysisLoader = AnalysisOptionsLoader();

final doubleLiteralFormatRule = DoubleLiteralFormatRule();

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

why is this one a variable while others are inline?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

My plan was to make them all inline and implement a common interface that exposes the fixes for each diagnostic code, so we can loop on all lints and register them then loop on all fixes per lint and register them

for (final rule in lintRules) {
  registry.registerLintRule(rule);
  for (final MapEntry(key: code, value: fixFn) in rule.fixesForCodes) {
    registry.registerFixForRule(code, fixFn);
  }
}

Should be implemented in #285

@solid-danylosafonov solid-danylosafonov left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Two small changes suggested, otherwise lgtm

Comment thread lib/src/lints/avoid_late_keyword/visitors/avoid_late_keyword_visitor.dart Outdated
Comment thread lib/src/lints/avoid_late_keyword/visitors/avoid_late_keyword_visitor.dart Outdated
@andrew-bekhiet-solid andrew-bekhiet-solid merged commit 16e3e13 into analysis_server_migration Jun 26, 2026
0 of 2 checks passed
@andrew-bekhiet-solid andrew-bekhiet-solid deleted the migrate/avoid_late_keyword branch June 26, 2026 15:59
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.

Migrate avoid_late_keyword

6 participants