Skip to content

Conversation

@marcusquinn
Copy link
Owner

@marcusquinn marcusquinn commented Feb 7, 2026

Summary

  • Replaced the 23-rule blanket # shellcheck disable=... line in 95 scripts with targeted disables containing only the rules each file actually needs
  • 4 scripts are now completely clean (zero disables)
  • 91 scripts have targeted disables (avg 3-5 rules vs 23 before)
  • Zero ShellCheck violations across all 95 modified files

Why

The blanket disable suppressed all warnings, making it impossible to identify real issues. Targeted disables make it clear which rules each script actually triggers, enabling incremental fixes.

Testing

  • bash -n syntax check: 95/95 pass
  • ShellCheck violations in modified files: 0
  • Supervisor state machine tests: 53/53 pass
  • Batch quality tests: 56/56 pass

Implements t135.2 from the Codebase Quality Hardening plan.

Summary by CodeRabbit

  • Chores
    • Updated static analysis configurations across 77+ script files by refining ShellCheck warning suppressions. Reduced overly broad linting exemptions to only necessary rules, improving code quality checks without affecting functionality or user experience.

…per-file disables (t135.2)

Replaced the 23-rule blanket '# shellcheck disable=...' line in 95 scripts
with targeted disables containing only the rules each file actually needs.

- 4 scripts now have zero ShellCheck disables (completely clean)
- 91 scripts have targeted disables (avg 3-5 rules vs 23 before)
- Zero ShellCheck violations across all 95 modified files
- All existing tests pass (53 state machine + 56 batch quality)

This makes it clear which rules each script actually triggers, making
future fixes easier to identify and prioritize.
@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 Feb 7, 2026

Warning

Rate limit exceeded

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

Walkthrough

This PR systematically reduces ShellCheck suppression directives across approximately 100 shell scripts in the .agents/scripts/ directory. Each script's header is modified to disable a narrower set of error codes, enforcing stricter linting standards while preserving all runtime behavior and logic.

Changes

Cohort / File(s) Summary
Archive Scripts
.agents/scripts/_archive/add-missing-returns.sh, fix-auth-headers.sh, fix-common-strings.sh, fix-content-type.sh, fix-error-messages.sh, fix-misplaced-returns.sh, fix-remaining-literals.sh, fix-return-statements.sh, fix-sc2155-simple.sh, fix-shellcheck-critical.sh, fix-string-literals.sh
Reduced ShellCheck disable directives in script headers to narrower subsets of codes, tightening linting constraints without affecting script logic.
Helper Scripts (A–C)
.agents/scripts/agent-browser-helper.sh, agno-setup.sh, auto-version-bump.sh, closte-helper.sh, cloudron-helper.sh, codacy-cli-chunked.sh, codacy-cli.sh, code-audit-helper.sh, coderabbit-cli.sh, coderabbit-pro-analysis.sh, comprehensive-quality-fix.sh, coolify-cli-helper.sh, coolify-helper.sh
Modified ShellCheck suppression pragmas to enforce stricter linting. Notable: closte-helper.sh and code-audit-helper.sh also include return 0 additions affecting control flow semantics.
Helper Scripts (D–M)
.agents/scripts/crawl4ai-examples.sh, crawl4ai-helper.sh, dev-browser-helper.sh, dns-helper.sh, dspy-helper.sh, dspyground-helper.sh, eeat-score-helper.sh, efficient-return-fix.sh, find-missing-returns.sh, git-platforms-helper.sh, gitea-cli-helper.sh, github-cli-helper.sh, gitlab-cli-helper.sh, hetzner-helper.sh, hostinger-helper.sh, keyword-research-helper.sh, linter-manager.sh, linters-local.sh, localhost-helper.sh, markdown-formatter.sh, markdown-lint-fix.sh, mass-fix-returns.sh, monitor-code-review.sh
Narrowed ShellCheck disable directives across diverse helper and utility scripts, reducing suppressed warning sets while maintaining functional integrity.
Helper Scripts (P–V)
.agents/scripts/pagespeed-helper.sh, pandoc-helper.sh, pre-commit-hook.sh, privacy-filter-helper.sh, qlty-cli.sh, quality-cli-manager.sh, quality-feedback-helper.sh, quality-fix.sh, secretlint-helper.sh, seo-analysis-helper.sh, seo-export-ahrefs.sh, seo-export-bing.sh, seo-export-dataforseo.sh, seo-export-gsc.sh, seo-export-helper.sh, servers-helper.sh, ses-helper.sh, setup-linters-wizard.sh, setup-local-api-keys.sh, setup-mcp-integrations.sh, shared-constants.sh, site-crawler-helper.sh, snyk-helper.sh, sonarcloud-autofix.sh, sonarcloud-cli.sh, sonarscanner-cli.sh, spaceship-helper.sh, stagehand-helper.sh, stagehand-python-helper.sh, stagehand-python-setup.sh, stagehand-setup.sh, system-cleanup.sh, test-stagehand-both-integration.sh, test-stagehand-integration.sh, test-stagehand-python-integration.sh, toon-helper.sh, twilio-helper.sh, updown-helper.sh, validate-mcp-integrations.sh, validate-version-consistency.sh, vaultwarden-helper.sh, vercel-cli-helper.sh, version-manager.sh, watercrawl-helper.sh, webhosting-helper.sh, webhosting-verify.sh, wordpress-mcp-helper.sh
Modified shellcheck suppression pragmas across remaining helper scripts to enforce tighter linting constraints. All changes involve narrowing disable lists; no functional or behavioral modifications.
Special Cases
101domains-helper.sh
Reduced ShellCheck disable directives to minimal subset (SC1091, SC2034, SC2155).

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Possibly related PRs

Poem

🔍 Lint rules refined, warnings now more keen,
A hundred scripts polished, ShellCheck's keen eye unseen.
Fewer exceptions granted, tighter standards set,
Zero tech debt sustained—DevOps excellence, no regret! ✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title precisely describes the main change: replacing blanket ShellCheck disables with targeted per-file disables across 95 scripts, which is the core objective of this PR.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feature/t135.2-shellcheck-targeted-disables

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.

The 'wait $pid' call returns the exit code of the background process.
Under set -euo pipefail (added in t135.1), a non-zero exit from
codacy-cli.sh kills the script before reaching the status check.
Use 'wait $pid || status=$?' to capture the exit code safely.
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 4

@@ -1,5 +1,5 @@
#!/usr/bin/env bash
# shellcheck disable=SC2034,SC2155,SC2317,SC2329,SC2016,SC2181,SC1091,SC2154,SC2015,SC2086,SC2129,SC2030,SC2031,SC2119,SC2120,SC2001,SC2162,SC2088,SC2089,SC2090,SC2029,SC2006,SC2153
# shellcheck disable=SC1091,SC2129,SC2317
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

SC2317 (unreachable code) is masking real bugs — don't suppress it, fix the root cause.

SC2317 fires because check_status and list_apps have misplaced return 0 statements that make subsequent code unreachable. Suppressing this warning hides functional bugs rather than silencing a false positive. See comments below on lines 175–188 and 150–153.

🤖 Prompt for AI Agents
In @.agents/scripts/cloudron-helper.sh at line 2, The shellcheck suppression is
hiding real unreachable-code bugs: the functions check_status and list_apps
contain misplaced early "return 0" statements that make later logic unreachable
and trigger SC2317; remove or relocate those premature returns so the full
function logic executes and place a single, final return at the intended
function exit, then remove SC2317 from the "# shellcheck disable=..." list;
update check_status and list_apps to return consistent exit codes only at the
end and run shellcheck to verify SC2317 no longer appears.

@@ -1,5 +1,5 @@
#!/usr/bin/env bash
# shellcheck disable=SC2034,SC2155,SC2317,SC2329,SC2016,SC2181,SC1091,SC2154,SC2015,SC2086,SC2129,SC2030,SC2031,SC2119,SC2120,SC2001,SC2162,SC2088,SC2089,SC2090,SC2029,SC2006,SC2153
# shellcheck disable=SC1091,SC2034,SC2154,SC2155,SC2162,SC2181,SC2317
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# First, check if the file exists and read the relevant sections
if [ -f ".agents/scripts/git-platforms-helper.sh" ]; then
  echo "=== Lines 1-10 of git-platforms-helper.sh ==="
  head -10 ".agents/scripts/git-platforms-helper.sh" | cat -n
  echo ""
  echo "=== File size ==="
  wc -l ".agents/scripts/git-platforms-helper.sh"
else
  echo "File not found"
fi

Repository: marcusquinn/aidevops

Length of output: 582


🏁 Script executed:

#!/bin/bash
# Search for SC2181 violations - checking $? instead of direct command evaluation
echo "=== SC2181 pattern: checking \$? in conditionals ==="
rg '\$\?' .agents/scripts/git-platforms-helper.sh -n | head -20

echo ""
echo "=== SC2317 pattern: code after return ==="
rg -A2 'return [0-9]' .agents/scripts/git-platforms-helper.sh -n | grep -E '^\s+[a-z]|return' | head -30

Repository: marcusquinn/aidevops

Length of output: 827


🏁 Script executed:

#!/bin/bash
# Check for the disable directive on line 2
echo "=== Line 2 content (the disable directive) ==="
sed -n '2p' .agents/scripts/git-platforms-helper.sh

echo ""
echo "=== Count disabled rules ==="
sed -n '2p' .agents/scripts/git-platforms-helper.sh | grep -oP 'SC\d+' | wc -l

Repository: marcusquinn/aidevops

Length of output: 212


🏁 Script executed:

#!/bin/bash
# Look for duplicate constants mentioned in review
echo "=== Checking for duplicate HELP_SHOW_MESSAGE ==="
rg 'HELP_SHOW_MESSAGE=' .agents/scripts/git-platforms-helper.sh -n

echo ""
echo "=== Checking for duplicate USAGE_COMMAND_OPTIONS ==="
rg 'USAGE_COMMAND_OPTIONS=' .agents/scripts/git-platforms-helper.sh -n

Repository: marcusquinn/aidevops

Length of output: 392


🏁 Script executed:

#!/bin/bash
# Check main() function structure around lines 519-540
echo "=== Lines 519-540 (main function area) ==="
sed -n '519,540p' .agents/scripts/git-platforms-helper.sh | cat -n

Repository: marcusquinn/aidevops

Length of output: 1048


Remove ShellCheck disables and fix the underlying issues instead of suppressing them—the script has critical execution bugs.

The targeted disable approach violates the zero-violations requirement. Verification confirms these suppressions mask real, fixable bugs:

  • SC2181 (6 violations): Lines 194, 214, 245, 265, 295, 406 use if [[ $? -eq 0 ]]—fix with direct command evaluation (if command; then)
  • Duplicate constants: Lines 14 and 22 define HELP_SHOW_MESSAGE identically; lines 15 and 23 define USAGE_COMMAND_OPTIONS identically—remove duplicates
  • Broken main() function (lines 520–540): Contains triple-duplicated variable assignments followed by contradictory overwrites. Lines 521–523 self-reference undefined variables (local account_name="$account_name"), causing empty/undefined assignments. Lines 533–536 then overwrite with different undefined variables. This pattern prevents the script from functioning correctly.

These issues are not ShellCheck false positives—they are runtime correctness bugs that must be fixed to meet the zero-technical-debt standard.

🤖 Prompt for AI Agents
In @.agents/scripts/git-platforms-helper.sh at line 2, Remove the ShellCheck
disables by fixing the root issues: replace all occurrences of post-command exit
checks like "if [[ $? -eq 0 ]]" with direct command tests (e.g., "if <command>;
then") to satisfy SC2181; remove the duplicate constant definitions for
HELP_SHOW_MESSAGE and USAGE_COMMAND_OPTIONS so each is defined only once; and
correct the broken main() function by declaring and assigning its local
variables exactly once from the intended sources (e.g., function parameters,
parsed options, or explicit env vars) instead of self-referencing undefined
names (remove lines like local account_name="$account_name" and the later
contradictory overwrites), ensuring variables are populated in a single, clear
assignment flow inside main().

@@ -1,5 +1,5 @@
#!/usr/bin/env bash
# shellcheck disable=SC2034,SC2155,SC2317,SC2329,SC2016,SC2181,SC1091,SC2154,SC2015,SC2086,SC2129,SC2030,SC2031,SC2119,SC2120,SC2001,SC2162,SC2088,SC2089,SC2090,SC2029,SC2006,SC2153
# shellcheck disable=SC1091,SC2129,SC2153,SC2317
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

SC2153 is suppressing a real bug — review before keeping this disable.

SC2153 warns about possible misspellings (e.g., SCRIPT_DIR vs script_dir). On line 289, a local script_dir (lowercase) is defined, but line 290 references $SCRIPT_DIR (uppercase), which is never assigned in this script. The SC2153 suppress is hiding the exact bug it was designed to catch.

SC1091, SC2129, and SC2317 are justified.

🤖 Prompt for AI Agents
In @.agents/scripts/setup-local-api-keys.sh at line 2, The SC2153 suppression is
hiding a real bug: the script defines a local variable script_dir but later
references $SCRIPT_DIR which is never set; update the references so the same
identifier is used consistently (either rename the definition to SCRIPT_DIR or
change all occurrences of $SCRIPT_DIR to $script_dir) and then remove the SC2153
disable; verify references in the block around the script_dir/SCRIPT_DIR
assignment and any functions that use it (look for script_dir and SCRIPT_DIR
symbols) so the variable is correctly assigned before use.

@@ -1,5 +1,5 @@
#!/usr/bin/env bash
# shellcheck disable=SC2034,SC2155,SC2317,SC2329,SC2016,SC2181,SC1091,SC2154,SC2015,SC2086,SC2129,SC2030,SC2031,SC2119,SC2120,SC2001,SC2162,SC2088,SC2089,SC2090,SC2029,SC2006,SC2153
# shellcheck disable=SC1091,SC2016,SC2154
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

SC2154 suppression is masking a real bug on Line 135.

The narrowed disable list is a clear improvement. However, SC2154 (variable referenced but not assigned) is included here specifically because $_arg2 on Line 135 is never defined in this script — that's a genuine bug, not a false positive. Rather than suppressing SC2154 to paper over it, fix the reference and drop SC2154 from the list entirely.

Proposed fix
-# shellcheck disable=SC1091,SC2016,SC2154
+# shellcheck disable=SC1091,SC2016

(after fixing $_arg2$2 on Line 135)

As per coding guidelines, "Use ShellCheck for all scripts with zero violations required." Suppressing SC2154 here hides a real undefined-variable defect rather than achieving genuine zero-violation compliance. Based on learnings: "Use ShellCheck for all scripts with zero violations required."

🤖 Prompt for AI Agents
In @.agents/scripts/sonarcloud-autofix.sh at line 2, The suppress-all for SC2154
is hiding a real undefined-variable bug: replace the incorrect variable
reference $_arg2 with $2 in the script (the occurrence currently used on Line
135) and remove SC2154 from the ShellCheck disable comment (the "# shellcheck
disable=SC1091,SC2016,SC2154" line) so the script no longer suppresses the
undefined-variable warning; keep the other disables (SC1091, SC2016) as-is if
still needed.

@github-actions
Copy link

github-actions bot commented Feb 7, 2026

🔍 Code Quality Report

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

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

�[0;34m[INFO]�[0m Recent monitoring activity:
Sat Feb 7 23:52:47 UTC 2026: Code review monitoring started
Sat Feb 7 23:52:47 UTC 2026: SonarCloud - Bugs: 0, Vulnerabilities: 0, Code Smells: 31

📈 Current Quality Metrics

  • BUGS: 0
  • CODE SMELLS: 31
  • VULNERABILITIES: 0

Generated on: Sat Feb 7 23:52:50 UTC 2026


Generated by AI DevOps Framework Code Review Monitoring

@sonarqubecloud
Copy link

sonarqubecloud bot commented Feb 7, 2026

@marcusquinn marcusquinn merged commit 720cbe6 into main Feb 7, 2026
19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant