t2955: Replace blanket 2>/dev/null with explicit file checks in shell-env.sh#2969
t2955: Replace blanket 2>/dev/null with explicit file checks in shell-env.sh#2969marcusquinn wants to merge 1 commit intomainfrom
Conversation
…nv.sh Address PR #2937 review feedback (gemini): grep with 2>/dev/null masks permission errors and other non-file-not-found failures. - Line 511: add [[ -f "$zshenv" ]] guard before grep (file may not exist when entering via the 'command -v zsh' branch) - Line 533: remove redundant 2>/dev/null (file existence already guaranteed by the check at lines 527-530) Closes #2955
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
|
Warning Rate limit exceeded
⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
✨ 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 |
🔍 Code Quality Report�[0;35m[MONITOR]�[0m Code Review Monitoring Report �[0;34m[INFO]�[0m Latest Quality Status: �[0;34m[INFO]�[0m Recent monitoring activity: 📈 Current Quality Metrics
Generated on: Fri Mar 6 04:12:19 UTC 2026 Generated by AI DevOps Framework Code Review Monitoring |
|
|
This PR appears orphaned — no active worker process found and no activity for 6+ hours. Flagging for re-dispatch. If work is still in progress, remove the |
|
Closing as superseded by #3003, which was merged today and addresses the same issue (#2955) more comprehensively (8 locations vs 2). PR #3003 was built on top of the current main including the GH#2993 PATH shim work, so it resolves the grep robustness concerns without reverting the shim layer. Rebasing this PR would either produce an empty diff or revert the GH#2993 PATH shim — neither outcome is useful. |



Summary
grepwith2>/dev/nullmasks permission errors and other non-file-not-found failures insetup_shellcheck_wrapper()[[ -f "$zshenv" ]]guard beforegrep— the file may not exist when entering via thecommand -v zshbranch of the outer condition2>/dev/null— file existence is already guaranteed by the[[ ! -f "$rc_file" ]]check +touchat lines 527-530Changes
Two targeted fixes in
setup-modules/shell-env.sh, both in thesetup_shellcheck_wrapper()function:grep -q 'SHELLCHECK_PATH' "$zshenv" 2>/dev/null→[[ -f "$zshenv" ]] && grep -q 'SHELLCHECK_PATH' "$zshenv"grep -q 'SHELLCHECK_PATH' "$rc_file" 2>/dev/null→grep -q 'SHELLCHECK_PATH' "$rc_file"Verification
$zshenvdoesn't exist, the[[ -f ]]short-circuits to false → falls through to theelsebranch which creates the file (same behaviour as before)Closes #2955