Skip to content

refactor: optimization#21

Merged
taygumus merged 4 commits intomainfrom
refactor/optimization
Jan 8, 2026
Merged

refactor: optimization#21
taygumus merged 4 commits intomainfrom
refactor/optimization

Conversation

@taygumus
Copy link
Owner

@taygumus taygumus commented Jan 8, 2026

Refactor shell scripts, CLI containers & dev workflow

Summary

This PR focuses on cleanup and refactoring of shell scripts and development tooling, with the goal of improving readability, robustness, and developer experience without over-engineering.

The changes are mostly internal and do not alter production behavior.


Key changes

Shell scripts

  • Standardized indentation to 2 spaces across all .sh files
  • Clear separation between:
    • entrypoint / main scriptsset -e
    • utility / library functions → explicit return 0/1, no set -e
  • Improved error handling:
    • return used consistently in functions
    • exit reserved for top-level scripts and signal handlers
    • errors printed to stderr where appropriate
  • Simplified helpers to avoid unnecessary abstraction and eval where not needed
  • More predictable control flow and clearer intent in all scripts

Docker / Compose (dev)

  • CLI containers (wp-cli, db-cli) kept running in dev only to allow fast docker compose exec workflows
  • Commands executed as secondary processes via exec, improving DX for common tasks
  • Clarified dev vs prod intent (in prod these tasks should run via run --rm)
  • Removed unnecessary complexity where Compose already provides correct behavior

Formatting & conventions

  • Shell scripts: 2 spaces, no tabs
  • YAML already aligned to 2 spaces
  • Makefile and nginx configs left compliant with their own language rules
  • Overall consistency across the codebase

Motivation

  • Reduce cognitive load when reading shell scripts
  • Avoid over-engineering and fragile abstractions
  • Make dev workflows faster and more predictable
  • Align scripts with common Docker and POSIX shell best practices

Scope

  • Refactor only (no feature changes)
  • No breaking changes expected
  • Production behavior unchanged

Notes

This PR intentionally favors clarity and pragmatism over maximal abstraction.
Validation is done at entrypoints, while internal functions assume valid inputs and focus on execution.

@taygumus taygumus self-assigned this Jan 8, 2026
@taygumus taygumus added the enhancement New feature or request label Jan 8, 2026
@taygumus taygumus merged commit 2581f4d into main Jan 8, 2026
4 checks passed
@taygumus taygumus deleted the refactor/optimization branch January 8, 2026 20:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant