Summary
The current pre-commit hook that prevents hard-coded hostnames (halos.local, halos.hal) in non-markdown files is effective but too strict. It blocks legitimate use cases where these hostnames appear in source code comments as examples.
Current Behavior
The lefthook pre-commit hook rejects any commit containing halos.local or halos.hal in non-markdown files, regardless of context.
Proposed Improvement
Replace the pre-commit hook with a CI workflow check that:
- Runs during pull request validation
- Scans for
halos.local and halos.hal in non-markdown files
- Allows the string when it appears in a comment line (e.g.,
// Example: halos.local, # halos.local is the default)
- Rejects the string when it appears in actual code (string literals, configuration values, etc.)
Benefits
- Developers can document examples using actual hostnames in comments
- CI catches real issues before merge
- Less friction during local development
- Better error messages with PR context
Implementation Notes
- The check could use language-aware comment detection or simple heuristics (line starts with
//, #, /*, etc.)
- Consider using a tool like
grep with pattern matching for comment prefixes
- Should work across common languages: JavaScript/TypeScript, Python, Bash, YAML (where
# is comment)
🤖 Generated with Claude Code
Summary
The current pre-commit hook that prevents hard-coded hostnames (
halos.local,halos.hal) in non-markdown files is effective but too strict. It blocks legitimate use cases where these hostnames appear in source code comments as examples.Current Behavior
The lefthook pre-commit hook rejects any commit containing
halos.localorhalos.halin non-markdown files, regardless of context.Proposed Improvement
Replace the pre-commit hook with a CI workflow check that:
halos.localandhalos.halin non-markdown files// Example: halos.local,# halos.local is the default)Benefits
Implementation Notes
//,#,/*, etc.)grepwith pattern matching for comment prefixes#is comment)🤖 Generated with Claude Code