Ignore commented out options from config - #83
Merged
Merged
Conversation
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
marked this pull request as draft
January 3, 2026 21:31
melounvitek
marked this pull request as ready for review
January 3, 2026 21:31
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.