Skip to content

Migrate/avoid global state#227

Merged
Islam-Shaaban-Ibrahim merged 5 commits intoanalysis_server_migrationfrom
migrate/avoid_global_state
Apr 15, 2026
Merged

Migrate/avoid global state#227
Islam-Shaaban-Ibrahim merged 5 commits intoanalysis_server_migrationfrom
migrate/avoid_global_state

Conversation

@Islam-Shaaban-Ibrahim
Copy link
Copy Markdown
Collaborator

Migrate avoid_global_state to analysis_server_plugin

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 migrates the solid_lints package from custom_lint_builder to the analysis_server_plugin framework, refactoring the AvoidGlobalStateRule and updating the test suite. Feedback points out a critical compilation error in the rule registration where the visitor's methods should be passed as tear-offs. Additionally, an improvement was suggested to optimize the mutability check by using the AST directly instead of the element model.

Comment thread lib/src/lints/avoid_global_state/avoid_global_state_rule.dart
Comment thread lib/src/lints/avoid_global_state/avoid_global_state_rule.dart Outdated
Copy link
Copy Markdown
Collaborator

@solid-vovabeloded solid-vovabeloded left a comment

Choose a reason for hiding this comment

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

Great start, @Islam-Shaaban-Ibrahim! I've added a couple of suggestions here - please, take a look.

Comment thread lib/src/lints/avoid_global_state/avoid_global_state_rule.dart Outdated
Comment thread lib/src/lints/avoid_global_state/avoid_global_state_rule.dart Outdated
Comment thread lib/main.dart
Comment thread lint_test/lib/main.dart Outdated
Comment thread test/avoid_global_state_rule_test.dart
Comment thread lint_test/avoid_global_state_test.dart Outdated
Comment thread lint_test/avoid_global_state_test.dart Outdated
Copy link
Copy Markdown
Collaborator

@solid-vovabeloded solid-vovabeloded left a comment

Choose a reason for hiding this comment

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

Good progress, @Islam-Shaaban-Ibrahim. I have a few more suggestions here and we would be good to go.

Comment thread lib/main.dart Outdated
Comment thread lint_test/pubspec.yaml Outdated
Comment thread test/avoid_global_state_rule_test.dart Outdated
Comment thread pubspec.yaml
Copy link
Copy Markdown
Collaborator

@solid-vovabeloded solid-vovabeloded left a comment

Choose a reason for hiding this comment

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

Added two more suggestions, but since they are minor, I'm approving them right away. Feel free to merge it once you apply these suggestions.

Comment thread lib/src/lints/avoid_global_state/visitors/avoid_global_state_rule_visitor.dart Outdated
Comment thread lib/main.dart Outdated
@Islam-Shaaban-Ibrahim Islam-Shaaban-Ibrahim merged commit 9b70b6e into analysis_server_migration Apr 15, 2026
0 of 2 checks passed
@Islam-Shaaban-Ibrahim Islam-Shaaban-Ibrahim deleted the migrate/avoid_global_state branch April 15, 2026 10:53
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.

2 participants