Skip to content

refactor: apply DRY, KISS, YAGNI to install.sh, patch-statusline.sh, …#27

Open
glauberlima wants to merge 1 commit intomainfrom
refactor/dry-kiss-yagni-scripts
Open

refactor: apply DRY, KISS, YAGNI to install.sh, patch-statusline.sh, …#27
glauberlima wants to merge 1 commit intomainfrom
refactor/dry-kiss-yagni-scripts

Conversation

@glauberlima
Copy link
Copy Markdown
Owner

…and tests

Reduces duplication and unnecessary complexity:

  • install.sh: Extract try_run() helper (replaces 13× set+e patterns), simplify generate_timestamp() to date +%s
  • patch-statusline.sh: Add validate_json() helper, loop marker validation
  • tests/shellcheck.sh: Simplify collect_files() to use find only, extract run_checker() to deduplicate check loops
  • tests/unit.sh: Loop color extraction (replaces 11× eval), remove duplicate get_context_tier() tests

Net: -112 lines, all tests pass (29/29 integration, 76/77 unit).

…and tests

Reduces duplication and unnecessary complexity:

- install.sh: Extract try_run() helper (replaces 13× set+e patterns),
  simplify generate_timestamp() to date +%s
- patch-statusline.sh: Add validate_json() helper, loop marker validation
- tests/shellcheck.sh: Simplify collect_files() to use find only,
  extract run_checker() to deduplicate check loops
- tests/unit.sh: Loop color extraction (replaces 11× eval),
  remove duplicate get_context_tier() tests

Net: -112 lines, all tests pass (29/29 integration, 76/77 unit).

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
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