Skip to content

migrate prefer early return rule with tests#232

Open
Islam-Shaaban-Ibrahim wants to merge 6 commits into
analysis_server_migrationfrom
migrate/prefer_early_return
Open

migrate prefer early return rule with tests#232
Islam-Shaaban-Ibrahim wants to merge 6 commits into
analysis_server_migrationfrom
migrate/prefer_early_return

Conversation

@Islam-Shaaban-Ibrahim
Copy link
Copy Markdown

No description provided.

Copy link
Copy Markdown

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

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 refactors the prefer_early_return lint rule to align with the AnalysisRule API, simplifying the rule definition and its associated visitor. Review feedback identifies a regression where if statements with else blocks are no longer excluded from reporting, potentially leading to undesirable lint triggers. There is also a concern regarding the use of RecursiveAstVisitor with addBlockFunctionBody, which may result in duplicate diagnostics for nested functions.

Comment thread lib/src/lints/prefer_early_return/visitors/prefer_early_return_visitor.dart Outdated
Comment thread lib/src/lints/prefer_early_return/prefer_early_return_rule.dart Outdated
Comment thread lib/src/lints/prefer_early_return/visitors/prefer_early_return_visitor.dart Outdated
Comment thread lib/src/lints/prefer_early_return/visitors/prefer_early_return_visitor.dart Outdated
Comment thread lib/src/lints/prefer_early_return/prefer_early_return_rule.dart Outdated
Comment thread test/prefer_early_return_rule_test.dart
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