refactor: move fixer to specific lang#1312
Conversation
WalkthroughThe Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant CLI
participant RunWithSpecificLang
participant Fixer
User->>CLI: Pass arguments including rewrite
CLI->>RunWithSpecificLang: Initialize with arguments
RunWithSpecificLang->>Fixer: Conditional initialization if rewrite is present
Fixer-->>RunWithSpecificLang: Return Fixer instance
RunWithSpecificLang->>RunWithSpecificLang: Store Fixer instance as rewrite
Note right of RunWithSpecificLang: Use &self.rewrite in Worker methods
Poem
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
There was a problem hiding this comment.
Actionable comments posted: 0
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (1)
- crates/cli/src/run.rs (2 hunks)
Additional comments not posted (3)
crates/cli/src/run.rs (3)
253-253: Addition ofrewritefield looks good.The
rewritefield of typeOption<Fixer<SgLang>>has been correctly added to theRunWithSpecificLangstruct.
260-264: Initialization ofrewritefield innewfunction looks good.The
rewritefield is correctly initialized based on the presence ofarg.rewrite. Error handling for pattern parsing is also appropriately managed.
287-287: Use ofself.rewriteinworkmethod looks good.The logic has been correctly adjusted to use
self.rewritedirectly, improving efficiency by avoiding recalculations.
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1312 +/- ##
==========================================
+ Coverage 71.98% 72.00% +0.02%
==========================================
Files 81 81
Lines 5683 5684 +1
==========================================
+ Hits 4091 4093 +2
+ Misses 1592 1591 -1 ☔ View full report in Codecov by Sentry. |
Summary by CodeRabbit
rewritecalculation in theRunWithSpecificLangstruct, enhancing performance during execution.