Skip to content

Make linter rule search smarter - #7539

Merged
parlough merged 10 commits into
dart-lang:mainfrom
khanak0509:linter-rules-smarter-search
Oct 20, 2026
Merged

parlough merged 10 commits into
dart-lang:mainfrom
khanak0509:linter-rules-smarter-search

Conversation

@khanak0509

@khanak0509 khanak0509 commented Sep 26, 2026 •

Copy link
Copy Markdown
Contributor

Linter rules search used to need an exact name match. Now spaces count as _ , and it also searches the description text.

Fixes #7504


Results before change:

Screenshot 2026-09-27 at 2 35 12 AM Screenshot 2026-09-27 at 2 37 08 AM

Results after change:

Screenshot 2026-09-27 at 2 35 26 AM Screenshot 2026-09-27 at 2 36 54 AM

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

Copy link
Copy Markdown
Contributor

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 enhances the linter rules search functionality by allowing users to search rules by both name and description. It introduces a new lintMatchesQuery utility function that performs case-insensitive matching and treats spaces in the query as underscores when matching rule names, alongside corresponding UI updates and tests. Feedback suggests optimizing lintMatchesQuery by reusing an existing _whitespacePattern regular expression instead of recompiling a new RegExp on every invocation to avoid unnecessary overhead during search filtering.

Comment thread site/lib/src/util.dart Resolved
@dart-github-bot

dart-github-bot commented Sep 28, 2026 •

Copy link
Copy Markdown
Collaborator

@parlough

parlough commented Oct 1, 2026

Copy link
Copy Markdown
Member

/gcbrun

@parlough

parlough commented Oct 1, 2026

Copy link
Copy Markdown
Member

Thanks for the PR @khanak0509! I will try to take a look today or tomorrow.

No need to update with main for now. If any conflicts arise, we can handle them then.

@parlough
parlough self-requested a review October 1, 2026 03:38
@parlough parlough self-assigned this Oct 1, 2026
@parlough parlough changed the title make linter rules search smarter Make linter rule search smarter Oct 20, 2026

@parlough parlough left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I pushed some small clean up but otherwise looks good to me. Thanks for tackling this and for being patient!

@parlough
parlough merged commit 79d17bd into dart-lang:main Oct 20, 2026
17 checks passed
@khanak0509

Copy link
Copy Markdown
Contributor Author

Thanks

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.

Linter rules search enhancements

3 participants