fix(codex): replace rg with portable grep -E#1031
fix(codex): replace rg with portable grep -E#1031Piolttx wants to merge 1 commit intoaffaan-m:mainfrom
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe shell script for Codex global-state validation was refactored to replace Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Greptile SummaryThis PR replaces all
Confidence Score: 5/5This PR is safe to merge; it is a straightforward portability fix with no logic changes. All changes are mechanical substitutions of ripgrep with POSIX grep -E, and \s* with [[:space:]]*. The semantics are identical for the patterns used here. No new issues are introduced, and no pre-existing logic is altered. No P0 or P1 findings were identified. No files require special attention. Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[check-codex-global-state.sh] --> B{File exists?}
B -- AGENTS.md --> C[grep -En: ECC root header]
B -- config.toml --> D[grep -En: multi_agent enabled]
C --> E{Match?}
D --> F{Match?}
E -- yes --> G[ok]
E -- no --> H[fail]
F -- yes --> G
F -- no --> H
D --> I[grep -En: collab absent]
D --> J[grep -En: persistent_instructions]
D --> K[grep -En: profiles.strict / profiles.yolo]
D --> L[grep -En: MCP sections loop]
I --> M{Absent?}
M -- yes --> G
M -- no --> H
J --> N{Present?}
N -- yes --> G
N -- no --> O[warn]
L --> P{Match?}
P -- yes --> G
P -- no --> H
Reviews (1): Last reviewed commit: "fix(codex): replace rg with portable gre..." | Re-trigger Greptile |
|
Superseded by #1039 which uses a search_file() fallback function. |
What Changed
Replace all `rg -n` calls in `scripts/codex/check-codex-global-state.sh` with `grep -En`.
Also update `\s*` patterns to `[[:space:]]*` for POSIX ERE compatibility.
Why This Change
`ripgrep` is not universally available. Systems without `rg` installed silently fail the codex sanity check. `grep -E` is POSIX-standard and available everywhere.
Testing Done
Type of Change
Summary by cubic
Make the codex sanity check portable by replacing
rgwithgrep -Eand using POSIX-compatible patterns. This prevents silent failures on systems withoutripgrep.rg -nwithgrep -Eninscripts/codex/check-codex-global-state.sh.\s*to[[:space:]]*for POSIX ERE compatibility.Written for commit c141398. Summary will update on new commits.
Summary by CodeRabbit