feat: avoid non null assertion ignored types#313
Conversation
…id_non_null_assertion test
There was a problem hiding this comment.
Code Review
This pull request introduces configuration support for the avoid_non_null_assertion lint rule, allowing users to specify ignored_types (such as IMap or BuiltMap) in analysis_options.yaml to bypass non-null assertion warnings on those types. The implementation includes parsing these parameters, updating the visitor to respect them, and adding corresponding unit tests. The review feedback suggests optimizing performance and robustness by using a Set<String> instead of an Iterable<String> for ignoredTypes to avoid repeated .toSet() conversions during AST traversal, and improving the JSON parsing logic to handle unexpected configuration formats gracefully.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
…pport string or map inputs
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request introduces configuration parameters for the avoid_non_null_assertion lint rule, allowing users to specify ignored_types (such as IMap or BuiltMap) where non-null assertions should be ignored. The feedback highlights a bug in AvoidNonNullAssertionParameters.fromJson where parsing a Map representation of ignored_types from YAML would result in an invalid string representation (e.g., "{IMap: null}") instead of extracting the keys. A code suggestion is provided to resolve this by using typed pattern matching to safely extract the keys.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
…tly extract keys from maps
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request introduces configuration support for the avoid_non_null_assertion lint rule, allowing users to specify ignored_types (such as IMap or BuiltMap) that should not trigger warnings. It adds the AvoidNonNullAssertionParameters model to parse these options, updates the rule and visitor to respect them, and includes comprehensive tests. The review feedback suggests using explicit type patterns in the switch expression within the parameter parser to improve safety and readability.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
…nParameters JSON decoding using typed patterns
Closes #165