Conversation
How to use the Graphite Merge QueueAdd either label to this PR to merge it via the merge queue:
You must have a Graphite account in order to use the merge queue. Sign up using this link. An organization admin has enabled the Graphite Merge Queue in this repository. Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue. |
…context_for_part Co-authored-by: camc314 <18101008+camc314@users.noreply.github.com>
CodSpeed Instrumentation Performance ReportMerging #13094 will not alter performanceComparing Summary
Footnotes |
There was a problem hiding this comment.
Pull Request Overview
This PR refactors the build_missing_curly_fix_context_for_part function in the JSX curly brace presence linter to replace regex-based whitespace detection with standard library character iteration. The change eliminates the dependency on lazy_regex for a simple non-whitespace character search.
Key changes:
- Replaced
lazy_regex!(r#"[\S]"#).find()withpart.char_indices().find(|(_, ch)| !ch.is_whitespace()) - Maintains identical functionality while improving readability and performance
- Removes regex dependency for this specific use case
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
You can also share your feedback on Copilot code review for a chance to win a $100 gift card. Take the survey.
This PR replaces the
lazy_regex!(r#"[\S]"#)usage in thebuild_missing_curly_fix_context_for_partfunction with simple whitespace checks using standard library functions.Changes
The function previously used a regex to find the first non-whitespace character:
This has been replaced with:
Benefits
lazy_regexfor this simple whitespace detectionchar::is_whitespace()is more efficient than regex for this use caseVerification
This change improves code clarity and performance while maintaining full backward compatibility.
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.