Skip to content

refactor: Remove Map from the default avoid_non_null_assertion configuration - #344

Merged
solid-illiaaihistov merged 2 commits into
solid-software:masterfrom
solid-illiaaihistov:165-remove-map-from-avoid_non_null_assertion
Aug 21, 2026
Merged

refactor: Remove Map from the default avoid_non_null_assertion configuration#344
solid-illiaaihistov merged 2 commits into
solid-software:masterfrom
solid-illiaaihistov:165-remove-map-from-avoid_non_null_assertion

Conversation

@solid-illiaaihistov

@solid-illiaaihistovsolid-illiaaihistov commented Aug 19, 2026

Copy link
Copy Markdown
Collaborator

Summary by CodeRabbit

  • New Features
    • Enabled the non-null assertion lint by default.
    • Map index access using non-null assertions is now reported unless the map type is configured as ignored.
    • Parenthesized map access follows the same configurable behavior.
  • Documentation
    • Updated guidance and examples for configuring ignored types, including Map, IMap, and BuiltMap.
  • Tests
    • Added coverage for reported and ignored map access scenarios.

@coderabbitai

coderabbitaiBot commented Aug 19, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: dc5bc415-de5a-415c-9c2f-e7895b186cb6

📥 Commits

Reviewing files that changed from the base of the PR and between 2ab63ad and 757162a.

📒 Files selected for processing (3)
  • lib/analysis_options.yaml
  • lib/src/lints/avoid_non_null_assertion/avoid_non_null_assertion_rule.dart
  • lib/src/lints/avoid_non_null_assertion/models/avoid_non_null_assertion_parameters.dart
🚧 Files skipped from review as they are similar to previous changes (2)
  • lib/src/lints/avoid_non_null_assertion/avoid_non_null_assertion_rule.dart
  • lib/src/lints/avoid_non_null_assertion/models/avoid_non_null_assertion_parameters.dart

Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

The avoid_non_null_assertion lint now reports map index access unless Map is listed in ignored_types. The visitor, default configuration, documentation, and tests reflect this behavior.

Changes

Avoid non-null assertion behavior

Layer / File(s)Summary
Ignored-type configuration and documentation
lib/analysis_options.yaml, lib/src/lints/avoid_non_null_assertion/...
The default configuration removes IMap and BuiltMap exceptions. Documentation describes Map through ignored_types and updates the configuration examples.
Map access reporting and validation
lib/src/lints/avoid_non_null_assertion/visitors/..., test/src/lints/avoid_non_null_assertion/...
The visitor uses configured ignored types instead of automatic map detection. Tests cover direct and parenthesized map access with and without Map ignored.

Estimated code review effort: 2 (Simple) | ~10 minutes

Merge Risk:⚪ Minimal · up to 75716

The PR is merge-ready after normal checks and review; no actionable merge-blocking risk remains.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check nameStatusExplanation
Description Check✅ PassedCheck skipped - CodeRabbit’s high-level summary is enabled.
Title check✅ PassedThe title clearly summarizes the main change: removing Map from the default avoid_non_null_assertion configuration.
Docstring Coverage✅ PassedNo functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check✅ PassedCheck skipped because no linked issues were found for this pull request.
Out of Scope Changes check✅ PassedCheck skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@solid-illiaaihistov
solid-illiaaihistov merged commit b463c36 into solid-software:masterAug 21, 2026
2 checks passed
@solid-illiaaihistov
solid-illiaaihistov deleted the 165-remove-map-from-avoid_non_null_assertion branch August 21, 2026 13:02
Sign up for freeto 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

@solid-illiaaihistov@danylo-safonov-solid