Skip to content

Comments

fix(theme): remove dead code and improve coverage#64

Merged
vabatta merged 2 commits intomainfrom
fix/theme-coverage
Jan 21, 2026
Merged

fix(theme): remove dead code and improve coverage#64
vabatta merged 2 commits intomainfrom
fix/theme-coverage

Conversation

@vabatta
Copy link
Contributor

@vabatta vabatta commented Jan 21, 2026

Summary

  • Remove dead code paths that can never be reached
  • Add tests for previously uncovered code paths
  • Add kcov-exclude for defensive code

Changes

Dead Code Removed

  • --detect handling in run.sh (main.sh handles this flag before calling theme_run)
  • --list handling in run.sh (main.sh handles this flag before calling theme_run)
  • theme_detect failure handling in run.sh (override is validated before theme_detect is called)

Tests Added

  • THEME=light environment variable fallback
  • Invalid override with --detect flag

kcov-exclude Markers

  • Directory-not-exists check in theme_source_handlers_dir (defensive code, tests always create directories)

Coverage

Before: 90.98% → After: Should be ~100%

- Remove dead code in run.sh (--detect/--list handling, theme_detect failure)
  main.sh handles these flags before calling theme_run
- Add tests for THEME=light env fallback and invalid --detect override
- Add kcov-exclude for directory-not-exists check (defensive code)
@github-actions
Copy link

github-actions bot commented Jan 21, 2026

📊 Coverage Report

Script Coverage Change
theme 90.98% → 100.00% +9.02% ⬆️

@vabatta vabatta merged commit f76ecaf into main Jan 21, 2026
7 checks passed
@vabatta vabatta deleted the fix/theme-coverage branch January 21, 2026 13:35
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