Skip to content

migrated avoid non null assertion rule and tests#230

Merged
Islam-Shaaban-Ibrahim merged 3 commits intoanalysis_server_migrationfrom
migrate/avoid_non_null
Apr 16, 2026
Merged

migrated avoid non null assertion rule and tests#230
Islam-Shaaban-Ibrahim merged 3 commits intoanalysis_server_migrationfrom
migrate/avoid_non_null

Conversation

@Islam-Shaaban-Ibrahim
Copy link
Copy Markdown
Collaborator

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 AvoidNonNullAssertionRule to extend AnalysisRule and introduces a visitor-based implementation for detecting non-null assertions. It also adds a new test suite for the rule. The review identifies a critical issue in the visitor where a lack of type promotion would lead to a compilation error when checking for Map types. There is also a suggestion to use more robust methods for identifying lint locations in tests instead of hardcoded offsets.

Comment thread test/avoid_non_null_assertion_rule_test.dart
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.

Overall, that looks pretty good. Just a few minor suggestions here.

Comment thread lib/src/lints/avoid_non_null_assertion/avoid_non_null_assertion_rule.dart Outdated
@Islam-Shaaban-Ibrahim Islam-Shaaban-Ibrahim merged commit 87f0bd5 into analysis_server_migration Apr 16, 2026
0 of 2 checks passed
@Islam-Shaaban-Ibrahim Islam-Shaaban-Ibrahim deleted the migrate/avoid_non_null branch April 16, 2026 08:12
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