Skip to content

fix: resolve rules configuration being ignored in nested directories#310

Open
solid-illiaaihistov wants to merge 4 commits into
solid-software:analysis_server_migrationfrom
solid-illiaaihistov:309-bug-rules-configuration-is-ignored-in-nested-directories
Open

fix: resolve rules configuration being ignored in nested directories#310
solid-illiaaihistov wants to merge 4 commits into
solid-software:analysis_server_migrationfrom
solid-illiaaihistov:309-bug-rules-configuration-is-ignored-in-nested-directories

Conversation

@solid-illiaaihistov

Copy link
Copy Markdown
Collaborator

Closes #309

@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 migrates the lint configurations from custom_lint to solid_lints and updates AnalysisOptionsLoader to resolve nested analysis_options.yaml files starting from the defining unit's directory rather than the package root. It also updates the YAML parsing logic to support both root-level and plugin-level configurations. Feedback suggests using Dart 3 pattern matching to safely extract the diagnostics block instead of using unsafe as casts, which would also allow removing the newly introduced _OptionsMap typedef.

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_loader.dart Outdated
Comment thread lib/src/common/parameter_parser/analysis_options_loader.dart Outdated
… and prevent crashes on invalid configurations
@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 updates the analysis options configuration format from custom_lint to solid_lints and modifies the rules from a list to a map format. It also updates AnalysisOptionsLoader to resolve analysis_options.yaml by traversing upwards from the directory of the file being analyzed rather than starting at the package root. The feedback identifies two issues: first, the directory traversal loop terminates before checking the root directory, which can be resolved by restructuring the loop; second, parsing nested configuration maps using Map<String, Object?>.from can throw a runtime TypeError if the keys are not strings, which can be avoided by defensively copying the map.

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_loader.dart Outdated
Comment thread lib/src/common/parameter_parser/analysis_options_loader.dart
…tring keys and fixing infinite loop in path traversal
@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 updates the configuration format in the analysis options files from custom_lint to solid_lints diagnostics. It also refactors AnalysisOptionsLoader to resolve the nearest analysis_options.yaml file relative to the file being analyzed rather than the package root, and improves YAML parsing robustness with additional test coverage. Feedback suggests wrapping the synchronous file read operation (readAsStringSync()) in a try-catch block to prevent potential crashes if the file is inaccessible.

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_loader.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 migrates the lint configurations from custom_lint to solid_lints and updates the AnalysisOptionsLoader to resolve the nearest analysis_options.yaml relative to the file being analyzed rather than the package root. It also hardens the YAML parsing logic to prevent crashes on malformed configurations and adds comprehensive unit tests to verify these changes. There are no review comments to address.

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

Closes #192

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