Skip to content

fix: support package-level analysis options and rule suppression#318

Open
solid-illiaaihistov wants to merge 4 commits into
solid-software:analysis_server_migrationfrom
solid-illiaaihistov:317-restore-package-default-options
Open

fix: support package-level analysis options and rule suppression#318
solid-illiaaihistov wants to merge 4 commits into
solid-software:analysis_server_migrationfrom
solid-illiaaihistov:317-restore-package-default-options

Conversation

@solid-illiaaihistov

Copy link
Copy Markdown
Collaborator

Closes #317

@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 refactors the solid_lints plugin to support nested and included analysis_options.yaml files, resolving package imports and relative paths, and introduces proxy wrappers to dynamically check for disabled or suppressed rules. Feedback on these changes highlights several critical issues: a platform-specific path resolution bug in PackageConfigResolver that bypasses the ResourceProvider abstraction; an in-place mutation of seenPaths in AnalysisOptionsParser that incorrectly flags diamond dependencies as cyclic; a potential memory leak caused by caching unmodifiable YamlMap and YamlList objects; and a stale cache bug in AnalysisOptionsLoader that prevents detecting newly created configuration files during active IDE sessions.

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.

Comment thread lib/src/common/parameter_parser/package_config_resolver.dart
Comment thread lib/src/common/parameter_parser/analysis_options_parser.dart
Comment thread lib/src/common/parameter_parser/analysis_options_parser.dart Outdated
Comment thread lib/src/common/parameter_parser/analysis_options_loader.dart
@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 refactors the solid_lints analyzer plugin to dynamically check for disabled rules and respect standard rule suppressions configured under analyzer: errors:. It introduces AnalysisOptionsParser and PackageConfigResolver to parse configurations and resolve package imports. The review feedback highlights several critical improvements: supporting multiple include files and recursively merging their configurations, restricting error suppression parsing to only the plugin's prefix to prevent collisions, and resolving caching issues in PackageConfigResolver that could lead to stale package configurations in long-running IDE sessions.

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.

Comment thread lib/src/common/parameter_parser/analysis_options_parser.dart
Comment thread lib/src/common/parameter_parser/analysis_options_parser.dart
Comment thread lib/src/common/parameter_parser/package_config_resolver.dart
@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 refactors the analysis options loading mechanism to support resolving and merging included configurations (both relative and package paths) and introduces proxy rules to dynamically manage enabled/disabled states. Feedback on the changes highlights several critical issues: a potential compile-time error in lib/main.dart due to a non-exhaustive switch expression on non-sealed classes, incorrect handling of false values under analyzer: errors: which unexpectedly enables rules, and a failure to handle null values under diagnostics: to re-enable rules. Additionally, there are potential runtime crashes identified, specifically a TypeError in AvoidUsingApiParameters when parsing non-map entries and a FormatException in PackageConfigResolver when parsing malformed package URIs.

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.

Comment thread lib/main.dart
Comment thread lib/src/common/parameter_parser/analysis_options_parser.dart Outdated
Comment thread lib/src/common/parameter_parser/analysis_options_parser.dart Outdated
Comment thread lib/src/lints/avoid_using_api/models/avoid_using_api_parameters.dart Outdated
Comment thread lib/src/common/parameter_parser/package_config_resolver.dart Outdated
@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 support for resolving included analysis options files and handling explicitly disabled rules. It refactors the analysis options loading logic into a dedicated parser and resolver, and introduces proxy wrappers to dynamically check if rules are disabled. The review feedback highlights critical compile-time errors, such as using a non-existent isScheme method on Uri and a non-exhaustive switch expression on lintRule. Additionally, several improvements are suggested to use type patterns with variable bindings for safer and more idiomatic Dart pattern matching.

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.

Comment thread lib/src/common/parameter_parser/package_config_resolver.dart
Comment thread lib/main.dart
Comment thread lib/src/common/parameter_parser/analysis_options_parser.dart
Comment thread lib/src/common/parameter_parser/analysis_options_parser.dart
Comment thread lib/src/common/parameter_parser/analysis_options_parser.dart
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