Repository navigation
[analysis] Filter analyzer rule AST visitor registration by target file path - #191159
Merged
auto-submit[bot] merged 15 commits intoAug 16, 2026
Merged
Conversation
… in IssueLinkSyntax
…nup to analyze_test
…le path Improves analyzer plugin performance by early-exiting in `registerNodeProcessors` for files that do not match rule file path criteria (`IssueLinkSyntax`, `IntegrationTestTimeouts`, `NoBadImportsInFlutter`), avoiding unnecessary AST visitor registration and per-node file path checks.
Contributor
There was a problem hiding this comment.
Code Review
This pull request migrates several custom analysis rules from the dev/bots script to the dev/flutter_analyzer_plugin as proper analyzer plugin rules, specifically adding IssueLinkSyntax and RepositoryLinkSyntax. It also removes the legacy custom rules and their associated tests. The feedback suggests removing an unused context parameter and field from the _Visitor class in the newly introduced RepositoryLinkSyntax rule.
|
|
||
| @override | ||
| void registerNodeProcessors(RuleVisitorRegistry registry, RuleContext context) { | ||
| final visitor = _Visitor(this, context); |
Contributor
Comment on lines
+65
to
+68
| _Visitor(this.rule, this.context); | ||
|
|
||
| final AnalysisRule rule; | ||
| final RuleContext context; |
Contributor
…tration # Conflicts: # dev/bots/test/analyze_test.dart # dev/flutter_analyzer_plugin/lib/src/rules/issue_link_syntax.dart # dev/flutter_analyzer_plugin/lib/src/rules/repository_link_syntax.dart
srawlins
approved these changes
Aug 16, 2026
This was referenced Aug 16, 2026
This was referenced Aug 17, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR optimizes static analysis performance in
dev/flutter_analyzer_pluginby early-exiting inregisterNodeProcessorsbased on file path for rules that only target specific files:IssueLinkSyntax: Early exits for unit tests (_test.dart) and the rule's definition file (issue_link_syntax.dart), removing_shouldSkip()from the visitor.IntegrationTestTimeouts: Early exits for non-integration-test files (files not containingtest_driverortest.dart), removing the redundant per-invocation file path check invisitMethodInvocation.NoBadImportsInFlutter: Early exits for files not inpackages/flutter/lib/src/, removing redundant path checks invisitImportDirective.This avoids unnecessary AST visitor registration and listener callbacks across non-applicable files in the repository.
Addresses feedback from @srawlins in #191127.
Related Issues
Tests
dev/flutter_analyzer_plugin/test/continue to pass.