Skip to content

Conversation

@marcusquinn
Copy link
Owner

Summary

  • Add color aliases (RED, GREEN, NC, etc.) and print_* short aliases (print_error, print_info, etc.) to shared-constants.sh so scripts can source it instead of defining their own inline copies
  • Migrate 163 scripts to source shared-constants.sh, removing ~2,900 lines of duplicated color definitions and print functions
  • Fix syntax error in clawdhub-helper.sh (invalid ); then || exit pattern from prior migration attempt)

Details

Before: 29/170 scripts (17%) sourced shared-constants.sh
After: 163/174 scripts (93.7%) source shared-constants.sh

The remaining 11 scripts either:

  • Use no color constants or print functions (10 scripts)
  • Use a namespaced color scheme (loop-common.sh with LC_ prefix) to avoid conflicts when sourced by other scripts

Changes to shared-constants.sh

  1. Color aliases: Added RED, GREEN, YELLOW, BLUE, PURPLE, CYAN, WHITE, NC as short aliases for the existing COLOR_* constants
  2. Print aliases: Added print_error(), print_success(), print_warning(), print_info() as short aliases for the existing print_shared_*() functions
  3. Exports: Added export for the new short color aliases

Per-script changes (163 scripts)

Each script received the same pattern:

  1. Add SCRIPT_DIR resolution (if not already present)
  2. Add source "${SCRIPT_DIR}/shared-constants.sh"
  3. Remove inline color constant definitions (RED=, GREEN=, NC=, etc.)
  4. Remove inline print_error/print_success/print_warning/print_info function definitions (where they duplicated shared-constants)
  5. Retain script-specific constants like BOLD, DIM that aren't in shared-constants

Quality checks

  • bash -n syntax check: 163/163 pass
  • No scripts use print_* without sourcing shared-constants.sh
  • No file deletions
  • No non-script files modified
  • Smoke-tested help commands on supervisor, mail, memory, version-manager, secret-helper

Closes t135.8

@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

Important

Review skipped

Too many files!

This PR contains 155 files, which is 5 over the limit of 150.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

  • 🔍 Trigger a full review
✨ 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.8

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.

Migrate 132 scripts to source shared-constants.sh, removing ~2800 lines
of duplicated inline print_*/color definitions:

- Add print_error/success/warning/info aliases to shared-constants.sh
- Add short color variable aliases (RED, GREEN, NC, etc.)
- Remove inline print_* function definitions from migrated scripts
- Remove inline color variable declarations (now provided by shared)
- Remove re-declared readonly constants that conflict with shared

11 scripts intentionally excluded (no color output or print functions).
All 171 scripts pass bash -n syntax validation.
Add color aliases (RED, GREEN, NC, etc.) and print_* short aliases
(print_error, print_info, etc.) to shared-constants.sh so scripts can
source it instead of defining their own inline copies.

Migrate 163 scripts to source shared-constants.sh, removing ~2900 lines
of duplicated color definitions and print functions. Fix syntax error
in clawdhub-helper.sh (invalid 'then || exit' pattern).

Remaining 11 scripts either use no colors/prints (10) or use a
namespaced color scheme (loop-common.sh with LC_ prefix).

Adoption: 163/174 scripts (93.7%), exceeding the 80%+ target.
@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, 28 code smells

�[0;34m[INFO]�[0m Recent monitoring activity:
Sat Feb 7 20:42:23 UTC 2026: Code review monitoring started
Sat Feb 7 20:42:23 UTC 2026: SonarCloud - Bugs: 0, Vulnerabilities: 0, Code Smells: 28
Sat Feb 7 20:42:24 UTC 2026: Qlty - 0 issues found, auto-formatting applied
Sat Feb 7 20:42:26 UTC 2026: Codacy analysis completed with auto-fixes

📈 Current Quality Metrics

  • BUGS: 0
  • CODE SMELLS: 28
  • VULNERABILITIES: 0

Generated on: Sat Feb 7 20:42:26 UTC 2026


Generated by AI DevOps Framework Code Review Monitoring

@sonarqubecloud
Copy link

sonarqubecloud bot commented Feb 7, 2026

@marcusquinn marcusquinn merged commit 7ce3b62 into main Feb 7, 2026
10 of 11 checks passed
marcusquinn added a commit that referenced this pull request Feb 7, 2026
…urce lines

PR #480 (shared-constants adoption) added source lines to scripts that
already had them from PR #479 (sed portability), causing double-sourcing.
Under set -euo pipefail, the second source fails on readonly re-declaration,
silently breaking supervisor-helper.sh (batch, help, all commands return 1).

Fix: Add include guard (_SHARED_CONSTANTS_LOADED) so shared-constants.sh
is safe to source multiple times. Also remove 5 duplicate source lines.
marcusquinn added a commit that referenced this pull request Feb 7, 2026
…urce lines (#483)

PR #480 (shared-constants adoption) added source lines to scripts that
already had them from PR #479 (sed portability), causing double-sourcing.
Under set -euo pipefail, the second source fails on readonly re-declaration,
silently breaking supervisor-helper.sh (batch, help, all commands return 1).

Fix: Add include guard (_SHARED_CONSTANTS_LOADED) so shared-constants.sh
is safe to source multiple times. Also remove 5 duplicate source lines.
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