Skip to content

chore: replace pre-commit hostname hook with smarter CI check #67

@mairas

Description

@mairas

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:

  1. Runs during pull request validation
  2. Scans for halos.local and halos.hal in non-markdown files
  3. Allows the string when it appears in a comment line (e.g., // Example: halos.local, # halos.local is the default)
  4. 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions