Skip to content

feat: avoid non null assertion ignored types#313

Open
solid-illiaaihistov wants to merge 5 commits into
solid-software:analysis_server_migrationfrom
solid-illiaaihistov:165-avoid-non-null-assertion-ignored-types
Open

feat: avoid non null assertion ignored types#313
solid-illiaaihistov wants to merge 5 commits into
solid-software:analysis_server_migrationfrom
solid-illiaaihistov:165-avoid-non-null-assertion-ignored-types

Conversation

@solid-illiaaihistov

Copy link
Copy Markdown
Collaborator

Closes #165

@solid-illiaaihistov solid-illiaaihistov changed the title 165 avoid non null assertion ignored types feat: avoid non null assertion ignored types Jul 3, 2026

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

Copy link
Copy Markdown

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 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.

@solid-illiaaihistov

Copy link
Copy Markdown
Collaborator Author

/gemini review

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

Copy link
Copy Markdown

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 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.

@solid-illiaaihistov

Copy link
Copy Markdown
Collaborator Author

/gemini review

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

Copy link
Copy Markdown

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 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
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.

1 participant