Skip to content

feat: implement lefthook pre-commit hooks across workspace repos #51

@mairas

Description

@mairas

Summary

Add lefthook pre-commit hooks to workspace repos to run format and lint checks locally before commits. This will catch CI failures early and reduce failed PR checks.

Background

CI checks fail frequently because formatting and linting issues are only caught after pushing to GitHub. There are currently no local git hooks to catch these issues before commit.

Tool Choice: Lefthook

  • Fast Go binary, zero runtime dependencies
  • Check-only mode (no auto-fix) to match CI behavior exactly
  • Pre-commit hooks only

Repos to Implement

Repo Language Issue PR
homarr-container-adapter Rust halos-org/homarr-container-adapter#20 halos-org/homarr-container-adapter#21
HALPI2-rust-daemon Rust hatlabs/HALPI2-rust-daemon#88 hatlabs/HALPI2-rust-daemon#89
container-packaging-tools Python halos-org/container-packaging-tools#136 halos-org/container-packaging-tools#137
cockpit-networkmanager-halos TypeScript halos-org/cockpit-networkmanager-halos#2 halos-org/cockpit-networkmanager-halos#3
cockpit-apt Python + TypeScript halos-org/cockpit-apt#122 halos-org/cockpit-apt#123

Implementation Plan

Per-repo tasks

  1. Add lefthook.yml configuration
  2. Add hooks-install command to run script
  3. Update README with developer setup instructions
  4. Test with lefthook run pre-commit
  5. Create PR

Workspace tasks

Developer Setup (after implementation)

# One-time: Install lefthook
brew install lefthook

# Per-repo: Enable hooks
cd <repo>
./run hooks-install

# Skip hooks when needed
git commit --no-verify -m "WIP: message"

Tracking

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions