Skip to content

t2955: Replace blanket 2>/dev/null with explicit file checks in shell-env.sh#2969

Closed
marcusquinn wants to merge 1 commit intomainfrom
bugfix/shell-env-grep-robustness
Closed

t2955: Replace blanket 2>/dev/null with explicit file checks in shell-env.sh#2969
marcusquinn wants to merge 1 commit intomainfrom
bugfix/shell-env-grep-robustness

Conversation

@marcusquinn
Copy link
Owner

Summary

  • Addresses PR fix: write SHELLCHECK_PATH to .zshenv for non-interactive shell coverage #2937 review feedback: grep with 2>/dev/null masks permission errors and other non-file-not-found failures in setup_shellcheck_wrapper()
  • Line 511: adds [[ -f "$zshenv" ]] guard before grep — the file may not exist when entering via the command -v zsh branch of the outer condition
  • Line 533: removes redundant 2>/dev/null — file existence is already guaranteed by the [[ ! -f "$rc_file" ]] check + touch at lines 527-530

Changes

Two targeted fixes in setup-modules/shell-env.sh, both in the setup_shellcheck_wrapper() function:

  1. Explicit file check (line 511): grep -q 'SHELLCHECK_PATH' "$zshenv" 2>/dev/null[[ -f "$zshenv" ]] && grep -q 'SHELLCHECK_PATH' "$zshenv"
  2. Remove redundant suppression (line 533): grep -q 'SHELLCHECK_PATH' "$rc_file" 2>/dev/nullgrep -q 'SHELLCHECK_PATH' "$rc_file"

Verification

  • ShellCheck passes clean
  • Logic preserved: when $zshenv doesn't exist, the [[ -f ]] short-circuits to false → falls through to the else branch which creates the file (same behaviour as before)

Closes #2955

…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
@gemini-code-assist
Copy link

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 6, 2026

Warning

Rate limit exceeded

@marcusquinn has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 4 minutes and 50 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: aae9f6d4-68c2-4189-b09b-fe482c13e0bb

📥 Commits

Reviewing files that changed from the base of the PR and between 5fc8fc2 and 99e2a22.

📒 Files selected for processing (1)
  • setup-modules/shell-env.sh
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch bugfix/shell-env-grep-robustness

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions
Copy link

github-actions bot commented Mar 6, 2026

🔍 Code Quality Report

�[0;35m[MONITOR]�[0m Code Review Monitoring Report

�[0;34m[INFO]�[0m Latest Quality Status:
SonarCloud: 0 bugs, 0 vulnerabilities, 108 code smells

�[0;34m[INFO]�[0m Recent monitoring activity:
Fri Mar 6 04:12:16 UTC 2026: Code review monitoring started
Fri Mar 6 04:12:17 UTC 2026: SonarCloud - Bugs: 0, Vulnerabilities: 0, Code Smells: 108

📈 Current Quality Metrics

  • BUGS: 0
  • CODE SMELLS: 108
  • VULNERABILITIES: 0

Generated on: Fri Mar 6 04:12:19 UTC 2026


Generated by AI DevOps Framework Code Review Monitoring

@sonarqubecloud
Copy link

sonarqubecloud bot commented Mar 6, 2026

@marcusquinn
Copy link
Owner Author

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 status:orphaned label.

@marcusquinn
Copy link
Owner Author

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.

@marcusquinn marcusquinn closed this Mar 6, 2026
@marcusquinn marcusquinn deleted the bugfix/shell-env-grep-robustness branch March 6, 2026 17:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

quality-debt: setup-modules/shell-env.sh — PR #2937 review feedback (medium)

1 participant