Skip to content

Ignore commented out options from config - #83

Merged
melounvitek merged 15 commits into
masterfrom
claude/find-bugs-nMAX6
Jan 3, 2026
Merged

melounvitek merged 15 commits into
masterfrom
claude/find-bugs-nMAX6

Conversation

@melounvitek

Copy link
Copy Markdown
Owner

No description provided.

claude and others added 15 commits January 3, 2026 11:07
Analyzed the Gotsha codebase and identified 13 bugs/issues:
- 3 critical bugs (unhandled failures, race conditions)
- 3 high priority issues (poor error messages, locale issues)
- 5 medium priority issues (security, validation, edge cases)
- 2 code quality issues

Issues are documented with severity, impact, and recommended fixes.
Bug: The grep patterns in post-commit and pre-push hooks were matching
commented-out configuration lines in config.toml. This caused hooks to
run even when users commented out settings like:
  # post_commit_tests = true

Fix: Updated grep patterns to only match lines where the setting appears
before any # comment character:
  - Old: grep -qE 'post_commit_tests\s*=\s*true'
  - New: grep -qE '^[^#]*post_commit_tests\s*=\s*true'

The pattern '^[^#]*' ensures we only match content from the start of the
line up to (but not including) any # character.

Changes:
- lib/gotsha/templates/git_hooks/post-commit: Updated grep pattern
- lib/gotsha/templates/git_hooks/pre-push: Updated grep pattern
- spec/gotsha/git_hooks_spec.rb: Added comprehensive test coverage

Tests verify:
- Commented lines don't match
- Active lines do match
- False values don't match
- Inline comments don't match
@melounvitek melounvitek self-assigned this Jan 3, 2026
@melounvitek
melounvitek marked this pull request as draft January 3, 2026 21:31
@melounvitek
melounvitek marked this pull request as ready for review January 3, 2026 21:31
@melounvitek
melounvitek merged commit 66452ea into master Jan 3, 2026
4 checks passed
@melounvitek
melounvitek deleted the claude/find-bugs-nMAX6 branch January 3, 2026 21:32
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.

2 participants