Extract the shell-syntax scanner from parse-command.ts into its own module
維護者通常 3 天內回覆
還沒有人認領這個 Issue。
評估
- 難度
- 4/5
- 預估耗時
- 3-5 天
- 新手友好度
- 44/100
- Issue 類型
- 重構
- 描述清晰度
- 描述清楚
- 活躍度
- 活躍
- 技術堆疊
- typescript
研究方向
Read src/shared/parse-command.ts, focusing on scanShellSyntax, skipHeredoc, walkBodyPayloads, and the placeholder and line-continuation helpers; use PR #2068 for context. Extract the scanner and its private helpers into src/shared/parse-command-scanner.ts, making their shared state explicit. Run the existing test suite; done when it passes without assertion changes and parseCommand's exported contract is unchanged.
由索引模型根據 Issue 內容生成。
描述
scanShellSyntax in src/shared/parse-command.ts is roughly two thirds of the file — 2,150 of 3,230 lines — and its two largest pieces, skipHeredoc and walkBodyPayloads, are inner closures that share mutable scanner state. Moving it into a module of its own would let each rule be read and tested on its own.
- Move
scanShellSyntaxand the helpers only it uses (skipHeredoc,walkBodyPayloads, the placeholder and line-continuation helpers) into e.g.src/shared/parse-command-scanner.ts, leavingparseCommandand the tokenizer as its only consumer. - Make the state the two closures share explicit at the boundary — which quote or substitution the scanner is inside, the results collected so far, the nesting depth — passed or returned as a named object instead of captured.
- Change no behavior:
parseCommand's exported contract stays as is, and the existing test suite stays green with no assertion changes.
Context: PR #2068 (https://github.com/Zoo-Code-Org/Zoo-Code/pull/2068), commit b193815dddcd6e82e80bf31bc5ea84dd15bd48e4.
- 主要語言
- TypeScript
- 星號
- 2k
- 分支
- 301
- 平均合併
- 3 天 14 小時
- 30 天內合併 PR
- 103
環境準備
- 沒有 Dockerfile 或 Docker Compose 檔案
- 有 Pull Request 範本
- 閱讀貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
Zoo-Code-Org/Zoo-Code 的其他 Issue
-
難度 2/5 1-3 小時 新手友好度 70/100
Zoo-Code-Org/Zoo-Code#2773 · 1 則留言 ·
維護者通常 3 天內回覆
-
難度 2/5 1-3 小時 新手友好度 68/100
Zoo-Code-Org/Zoo-Code#2717 · 1 則留言 ·
維護者通常 3 天內回覆
-
難度 2/5 1-3 小時 新手友好度 77/100
Zoo-Code-Org/Zoo-Code#2515 ·
維護者通常 3 天內回覆
-
fix(scripts): stryker-diff.mjs spawns the extensionless .bin shim and cannot run on Windows可能已有人在做 @easonLiangWorldedtech 於 16 天前認領。 未關閉
難度 2/5 1-3 小時 新手友好度 78/100
Zoo-Code-Org/Zoo-Code#2514 ·
維護者通常 3 天內回覆
-
[BUG] search_files hides matching text on long lines可能已有人在做 @DananjayaNadun 於 9 天前認領。 未關閉
難度 2/5 1-3 小時 新手友好度 74/100
Zoo-Code-Org/Zoo-Code#2496 · 1 則留言 · 已指派 1 人 ·
維護者通常 3 天內回覆
查看 Zoo-Code-Org/Zoo-Code 的全部 Issue
相似的 Issue
-
enhancement feature/signals self-driving team/self-driving
難度 2/5 1-3 小時 新手友好度 78/100
PostHog/posthog#144208 · 1 則留言 ·
維護者通常 1 天內回覆
-
bug good first issue web
難度 2/5 1-3 小時 新手友好度 78/100
維護者通常 1 天內回覆
-
triage: not actionable
難度 2/5 1-3 小時 新手友好度 66/100
oxc-project/oxc#30518 · 1 則留言 ·
維護者通常 1 天內回覆
-
bug Claude useability
難度 2/5 1-3 小時 新手友好度 78/100
-
難度 2/5 1-3 小時 新手友好度 70/100
wazuh/wazuh-dashboard-plugins#9751 ·
維護者通常 1 天內回覆