Skip to content

t1344: Fix ShellCheck SC1091 noise from sourced files#2427

Merged
alex-solovyev merged 3 commits intomainfrom
chore/fix-sc1091-noise
Feb 27, 2026
Merged

t1344: Fix ShellCheck SC1091 noise from sourced files#2427
alex-solovyev merged 3 commits intomainfrom
chore/fix-sc1091-noise

Conversation

@alex-solovyev
Copy link
Collaborator

Summary

  • Adds root .shellcheckrc with source-path=SCRIPTDIR so ShellCheck resolves sourced files (shared-constants.sh, _common.sh) relative to each script's directory
  • Adds -P SCRIPTDIR flag to ShellCheck invocations in linters-local.sh, verify-run-helper.sh, and quality-fix.sh
  • Removes SC1091 from 129 file-level disable directives across 138 files
  • Removes redundant # shellcheck source=shared-constants.sh annotations
  • Adds targeted inline SC1090 disables only where truly needed (runtime credential paths, venv activate)

Net result: -73 lines of noise suppression. SC1091 is now resolved at the root cause instead of being silenced per-file.

Approach

The issue offered 3 options. Option 1 (pass -x to ShellCheck) was already in use but insufficient because ShellCheck couldn't resolve the dynamic $SCRIPT_DIR/shared-constants.sh paths. The fix combines:

  1. Root .shellcheckrc with source-path=SCRIPTDIR — tells ShellCheck to look in the script's own directory for sourced files. This is picked up automatically by editors, CI, and all ShellCheck invocations.
  2. -P SCRIPTDIR flag in the main linting scripts — belt-and-suspenders for explicit invocations.
  3. Cleanup of 129+ scattered # shellcheck disable=SC1091 directives that were just noise suppression.

Verification

  • Tested 35+ previously-affected scripts: zero SC1091/SC1090 warnings at --severity=warning
  • linters-local.sh ShellCheck phase produces no SC1091 output
  • Pre-existing warnings (e.g., SC2120 in chrome-webstore-helper.sh) unchanged

Closes #2410

@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!

@github-actions github-actions bot added the bug Auto-created from TODO.md tag label Feb 27, 2026
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 27, 2026

Warning

Rate limit exceeded

@alex-solovyev has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 14 minutes and 22 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.

📥 Commits

Reviewing files that changed from the base of the PR and between 6dd285c and 39ff108.

📒 Files selected for processing (140)
  • .agents/scripts/101domains-helper.sh
  • .agents/scripts/accessibility-audit-helper.sh
  • .agents/scripts/accessibility-helper.sh
  • .agents/scripts/agent-browser-helper.sh
  • .agents/scripts/agent-test-helper.sh
  • .agents/scripts/agno-setup.sh
  • .agents/scripts/ai-cli-config.sh
  • .agents/scripts/anti-detect-helper.sh
  • .agents/scripts/archived/audit-task-creator-helper.sh
  • .agents/scripts/archived/coderabbit-pulse-helper.sh
  • .agents/scripts/archived/finding-to-task-helper.sh
  • .agents/scripts/archived/quality-sweep-helper.sh
  • .agents/scripts/archived/review-pulse-helper.sh
  • .agents/scripts/auto-version-bump.sh
  • .agents/scripts/budget-tracker-helper.sh
  • .agents/scripts/chrome-webstore-helper.sh
  • .agents/scripts/cloudron-helper.sh
  • .agents/scripts/codacy-cli-chunked.sh
  • .agents/scripts/codacy-cli.sh
  • .agents/scripts/codacy-collector-helper.sh
  • .agents/scripts/code-audit-helper.sh
  • .agents/scripts/coderabbit-cli.sh
  • .agents/scripts/coderabbit-collector-helper.sh
  • .agents/scripts/coderabbit-pro-analysis.sh
  • .agents/scripts/coolify-cli-helper.sh
  • .agents/scripts/coolify-helper.sh
  • .agents/scripts/crawl4ai-examples.sh
  • .agents/scripts/crawl4ai-helper.sh
  • .agents/scripts/cron-dispatch.sh
  • .agents/scripts/dev-browser-helper.sh
  • .agents/scripts/dns-helper.sh
  • .agents/scripts/document-creation-helper.sh
  • .agents/scripts/document-extraction-helper.sh
  • .agents/scripts/dspy-helper.sh
  • .agents/scripts/dspyground-helper.sh
  • .agents/scripts/eeat-score-helper.sh
  • .agents/scripts/email-batch-convert-helper.sh
  • .agents/scripts/email-signature-parser-helper.sh
  • .agents/scripts/enhancor-helper.sh
  • .agents/scripts/fallback-chain-helper.sh
  • .agents/scripts/frontmatter-helper.sh
  • .agents/scripts/git-platforms-helper.sh
  • .agents/scripts/gitea-cli-helper.sh
  • .agents/scripts/github-cli-helper.sh
  • .agents/scripts/gitlab-cli-helper.sh
  • .agents/scripts/gsc-sitemap-helper.sh
  • .agents/scripts/hetzner-helper.sh
  • .agents/scripts/higgsfield-helper.sh
  • .agents/scripts/hostinger-helper.sh
  • .agents/scripts/issue-sync-helper.sh
  • .agents/scripts/issue-sync-lib.sh
  • .agents/scripts/keyword-research-helper.sh
  • .agents/scripts/linter-manager.sh
  • .agents/scripts/linters-local.sh
  • .agents/scripts/local-model-helper.sh
  • .agents/scripts/localdev-helper.sh
  • .agents/scripts/localhost-helper.sh
  • .agents/scripts/loop-common.sh
  • .agents/scripts/mail-helper.sh
  • .agents/scripts/markdown-formatter.sh
  • .agents/scripts/markdown-lint-fix.sh
  • .agents/scripts/mcp-register-claude.sh
  • .agents/scripts/memory-audit-pulse.sh
  • .agents/scripts/memory-graduate-helper.sh
  • .agents/scripts/model-availability-helper.sh
  • .agents/scripts/model-registry-helper.sh
  • .agents/scripts/monitor-code-review.sh
  • .agents/scripts/muapi-helper.sh
  • .agents/scripts/observability-helper.sh
  • .agents/scripts/ocr-receipt-helper.sh
  • .agents/scripts/pagespeed-helper.sh
  • .agents/scripts/pandoc-helper.sh
  • .agents/scripts/peekaboo-helper.sh
  • .agents/scripts/pipecat-helper.sh
  • .agents/scripts/pre-commit-hook.sh
  • .agents/scripts/privacy-filter-helper.sh
  • .agents/scripts/prompt-guard-helper.sh
  • .agents/scripts/qlty-cli.sh
  • .agents/scripts/quality-cli-manager.sh
  • .agents/scripts/quality-feedback-helper.sh
  • .agents/scripts/quality-fix.sh
  • .agents/scripts/quickfile-helper.sh
  • .agents/scripts/real-video-enhancer-helper.sh
  • .agents/scripts/response-scoring-helper.sh
  • .agents/scripts/rosetta-audit-helper.sh
  • .agents/scripts/secretlint-helper.sh
  • .agents/scripts/seed-bracket-helper.sh
  • .agents/scripts/seo-analysis-helper.sh
  • .agents/scripts/seo-export-ahrefs.sh
  • .agents/scripts/seo-export-bing.sh
  • .agents/scripts/seo-export-dataforseo.sh
  • .agents/scripts/seo-export-gsc.sh
  • .agents/scripts/seo-export-helper.sh
  • .agents/scripts/servers-helper.sh
  • .agents/scripts/ses-helper.sh
  • .agents/scripts/setup-linters-wizard.sh
  • .agents/scripts/setup-local-api-keys.sh
  • .agents/scripts/setup-mcp-integrations.sh
  • .agents/scripts/shannon-helper.sh
  • .agents/scripts/site-crawler-helper.sh
  • .agents/scripts/snyk-helper.sh
  • .agents/scripts/sonarcloud-autofix.sh
  • .agents/scripts/sonarcloud-cli.sh
  • .agents/scripts/sonarcloud-collector-helper.sh
  • .agents/scripts/sonarscanner-cli.sh
  • .agents/scripts/spaceship-helper.sh
  • .agents/scripts/stagehand-helper.sh
  • .agents/scripts/stagehand-python-helper.sh
  • .agents/scripts/stagehand-python-setup.sh
  • .agents/scripts/stagehand-setup.sh
  • .agents/scripts/supervisor-archived/ai-actions.sh
  • .agents/scripts/supervisor-archived/ai-context.sh
  • .agents/scripts/supervisor-archived/ai-reason.sh
  • .agents/scripts/supervisor-archived/cron.sh
  • .agents/scripts/system-cleanup.sh
  • .agents/scripts/test-ocr-extraction-pipeline.sh
  • .agents/scripts/test-stagehand-both-integration.sh
  • .agents/scripts/test-stagehand-integration.sh
  • .agents/scripts/test-stagehand-python-integration.sh
  • .agents/scripts/toon-helper.sh
  • .agents/scripts/transcription-helper.sh
  • .agents/scripts/twilio-helper.sh
  • .agents/scripts/uncloud-helper.sh
  • .agents/scripts/updown-helper.sh
  • .agents/scripts/validate-mcp-integrations.sh
  • .agents/scripts/validate-version-consistency.sh
  • .agents/scripts/vaultwarden-helper.sh
  • .agents/scripts/vercel-cli-helper.sh
  • .agents/scripts/verify-run-helper.sh
  • .agents/scripts/version-manager.sh
  • .agents/scripts/video-gen-helper.sh
  • .agents/scripts/voice-pipeline-helper.sh
  • .agents/scripts/wappalyzer-helper.sh
  • .agents/scripts/watercrawl-helper.sh
  • .agents/scripts/wavespeed-helper.sh
  • .agents/scripts/webhosting-helper.sh
  • .agents/scripts/webhosting-verify.sh
  • .agents/scripts/wordpress-mcp-helper.sh
  • .codefactor.yml
  • .shellcheckrc
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch chore/fix-sc1091-noise

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

🔍 Code Quality Report

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

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

�[0;34m[INFO]�[0m Recent monitoring activity:
Fri Feb 27 01:42:55 UTC 2026: Code review monitoring started
Fri Feb 27 01:42:55 UTC 2026: SonarCloud - Bugs: 0, Vulnerabilities: 0, Code Smells: 89

📈 Current Quality Metrics

  • BUGS: 0
  • CODE SMELLS: 89
  • VULNERABILITIES: 0

Generated on: Fri Feb 27 01:42:57 UTC 2026


Generated by AI DevOps Framework Code Review Monitoring

Add root .shellcheckrc with source-path=SCRIPTDIR so ShellCheck resolves
sourced files (shared-constants.sh, _common.sh) relative to each script's
directory. This eliminates SC1091 warnings at the source rather than
suppressing them per-file.

Changes:
- Add .shellcheckrc with source-path=SCRIPTDIR
- Add -P SCRIPTDIR flag to shellcheck invocations in linters-local.sh,
  verify-run-helper.sh, and quality-fix.sh
- Remove SC1091 from 129 file-level disable directives across 138 files
- Remove redundant shellcheck source= annotations for shared-constants.sh
- Remove file-level SC1090 disables where SCRIPTDIR resolves the source
- Add targeted inline SC1090 disables for credentials.sh (runtime path)
- Keep inline SC1091 disable for venv/activate (doesn't exist at lint time)

Net: -73 lines of shellcheck noise suppression.

Closes #2410
…alse positives (t1344)

The initial SC1091 cleanup incorrectly removed compound disable directives
(e.g., SC1091,SC2016,SC2034) entirely instead of keeping the non-SC1091 codes.
This caused CodeFactor to report 642 new issues.

Changes:
- Restore 27 inline shellcheck disable directives (SC2016, SC2086, SC2154)
  that were collateral damage from the SC1091 removal
- Add disable=SC2329,SC2317 to .shellcheckrc (project-wide false positives
  from library/sourced-file architecture)
- Exclude archived/ and tests/ dirs from CodeFactor analysis
…(t1344)

Add SC2034, SC2001, SC2059, SC2012, SC2030, SC2031, SC2015, SC2129,
SC2153, SC2004, SC2009 as project-wide accepted patterns. These are
informational/style issues that are intentional in this codebase
(library architecture, dynamic format strings, sed preferences, etc.).
@github-actions
Copy link

🔍 Code Quality Report

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

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

�[0;34m[INFO]�[0m Recent monitoring activity:
Fri Feb 27 02:43:12 UTC 2026: Code review monitoring started
Fri Feb 27 02:43:12 UTC 2026: SonarCloud - Bugs: 0, Vulnerabilities: 0, Code Smells: 53

📈 Current Quality Metrics

  • BUGS: 0
  • CODE SMELLS: 53
  • VULNERABILITIES: 0

Generated on: Fri Feb 27 02:43:15 UTC 2026


Generated by AI DevOps Framework Code Review Monitoring

@sonarqubecloud
Copy link

@marcusquinn
Copy link
Owner

Follow-up: source-path=SCRIPTDIR removed in PR #2939

This PR (t1344) added source-path=SCRIPTDIR to .shellcheckrc to suppress SC1091 noise. That fix worked for its intended purpose but was later identified as the root cause of catastrophic memory expansion (11 GB RSS, kernel panics — GH#2915) when combined with --external-sources.

PR #2939 reverses this approach: removes source-path=SCRIPTDIR and instead disables SC1091 globally. SC1091 is info-level and ShellCheck can't resolve dynamic paths (${SCRIPT_DIR}/foo.sh) used by 255 of 404 scripts anyway — so source-path=SCRIPTDIR only partially worked.

Upstream hazard note: The bash-language-server still hardcodes --external-sources — other opencode/shellcheck users with source-path in their .shellcheckrc will hit the same issue. See anomalyco/opencode#16209.

@opencode-agent
Copy link

opencode-agent bot commented Mar 5, 2026

fatal: couldn't find remote ref chore/fix-sc1091-noise

opencode session  |  github run

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Auto-created from TODO.md tag

Projects

None yet

Development

Successfully merging this pull request may close these issues.

coderabbit: Fix ShellCheck SC1091 noise from sourced files

2 participants