{"id":50825397,"url":"https://github.com/openshift-hyperfleet/hyperfleet-hooks","last_synced_at":"2026-06-13T18:05:14.487Z","repository":{"id":349747992,"uuid":"1113652735","full_name":"openshift-hyperfleet/hyperfleet-hooks","owner":"openshift-hyperfleet","description":" Pre-commit hooks registry for HyperFleet project ecosystem","archived":false,"fork":false,"pushed_at":"2026-06-08T17:32:07.000Z","size":89,"stargazers_count":0,"open_issues_count":0,"forks_count":4,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-06-08T19:19:42.141Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/openshift-hyperfleet.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":"AGENTS.md","dco":null,"cla":null}},"created_at":"2025-12-10T09:22:50.000Z","updated_at":"2026-06-08T17:32:12.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/openshift-hyperfleet/hyperfleet-hooks","commit_stats":null,"previous_names":["openshift-hyperfleet/hyperfleet-hooks"],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/openshift-hyperfleet/hyperfleet-hooks","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openshift-hyperfleet%2Fhyperfleet-hooks","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openshift-hyperfleet%2Fhyperfleet-hooks/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openshift-hyperfleet%2Fhyperfleet-hooks/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openshift-hyperfleet%2Fhyperfleet-hooks/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/openshift-hyperfleet","download_url":"https://codeload.github.com/openshift-hyperfleet/hyperfleet-hooks/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openshift-hyperfleet%2Fhyperfleet-hooks/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34294416,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-13T02:00:06.617Z","response_time":62,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-06-13T18:05:13.704Z","updated_at":"2026-06-13T18:05:14.480Z","avatar_url":"https://github.com/openshift-hyperfleet.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# HyperFleet Hooks\n\nShared validation tools for all HyperFleet projects. This repository is not meant to be cloned or built manually — it is consumed automatically by the [pre-commit](https://pre-commit.com/) framework and by Prow CI via a container image.\n\n## How It Works\n\n### For Developers (pre-commit hook)\n\nAny HyperFleet repository can enforce commit message validation by adding a `.pre-commit-config.yaml` file. The `pre-commit` framework will automatically clone this repository, build the Go binary, cache it, and run it on every commit. No changes to the consuming repository's Makefile or build system are needed.\n\n1. Install the pre-commit framework (one-time):\n\n   ```bash\n   pip install pre-commit\n   ```\n\n2. Add a `.pre-commit-config.yaml` to your repository:\n\n   ```yaml\n   repos:\n     - repo: https://github.com/openshift-hyperfleet/hyperfleet-hooks\n       rev: v0.1.0  # pin to a specific tag\n       hooks:\n         - id: hyperfleet-commitlint\n   ```\n\n3. Install the hook:\n\n   ```bash\n   pre-commit install --hook-type commit-msg\n   ```\n\nFrom this point on, every `git commit` in that repository will validate the commit message automatically. The developer does not need to install Go, clone this repo, or run `make build`.\n\n### For CI (Prow)\n\nIn Prow, a pre-built container image (`quay.io/openshift-hyperfleet/hyperfleet-git-hooks`) is used to validate all commits and the PR title. See the [commitlint documentation](docs/commitlint.md) for Prow configuration details.\n\n## Available Hooks\n\n| Hook ID | Stage | Description |\n| --- | --- | --- |\n| `hyperfleet-commitlint` | `commit-msg` | Validates commit messages against the [HyperFleet Commit Standard](https://github.com/openshift-hyperfleet/architecture/blob/main/hyperfleet/standards/commit-standard.md) |\n| `hyperfleet-golangci-lint` | `pre-commit` | Runs `make lint` — leverages the repo's existing bingo-managed golangci-lint |\n| `hyperfleet-gofmt` | `pre-commit` | Runs `make gofmt` — checks Go file formatting |\n| `hyperfleet-go-vet` | `pre-commit` | Runs `make go-vet` — finds suspicious constructs in Go code |\n\n### Commitlint\n\nValidates commit messages and PR titles against the [HyperFleet Commit Standard](https://github.com/openshift-hyperfleet/architecture/blob/main/hyperfleet/standards/commit-standard.md).\n\n**[→ Full Documentation](docs/commitlint.md)**\n\n### Go Tooling Hooks\n\nThe Go tooling hooks use `language: system` and delegate to the consuming repo's existing Make targets (`make lint`, `make gofmt`, `make go-vet`). This leverages the repo's existing [bingo](https://github.com/bwplotka/bingo)-managed tool resolution without reimplementing it. See the [dependency pinning standard](https://github.com/openshift-hyperfleet/architecture/blob/main/hyperfleet/standards/dependency-pinning.md) for details.\n\n**[→ Documentation](docs/go-tooling.md)**\n\n## Installation\n\n### Prerequisites\n\n- [pre-commit](https://pre-commit.com/#install) installed\n- Go 1.25+ available (for the `commitlint` hook — built automatically by pre-commit)\n- `make` targets (`lint`, `gofmt`, `go-vet`) in the consuming repo (for Go tooling hooks)\n\n### Adding to your repository\n\nAdd this to your `.pre-commit-config.yaml`:\n\n```yaml\nrepos:\n  - repo: https://github.com/openshift-hyperfleet/hyperfleet-hooks\n    rev: main # Use latest release tag\n    hooks:\n      - id: hyperfleet-commitlint\n      - id: hyperfleet-golangci-lint\n      - id: hyperfleet-gofmt\n      - id: hyperfleet-go-vet\n```\n\nThen install the hooks:\n\n```bash\npre-commit install --hook-type commit-msg\npre-commit install --hook-type pre-commit\n```\n\n**Note**: The `commitlint` hook is built automatically by pre-commit (`language: golang`). The Go tooling hooks (`golangci-lint`, `gofmt`, `go-vet`) use `language: system` and require the consuming repo to have the corresponding Make targets.\n\nSee [commitlint documentation](docs/commitlint.md) for Prow CI setup and [go-tooling documentation](docs/go-tooling.md) for bingo configuration.\n\n## Development\n\nThese instructions are only needed if you are contributing to this repository.\n\n```bash\nmake build    # Build binary\nmake test     # Run tests\nmake lint     # Run linters (requires golangci-lint, managed by bingo)\nmake image    # Build container image\n```\n\n### Releasing a New Version\n\n1. Create and push a release tag:\n\n   ```bash\n   git tag v0.1.0\n   git push upstream v0.1.0\n   ```\n\n2. Build the linux/amd64 binary and create a GitHub release with it:\n\n   ```bash\n   GOOS=linux GOARCH=amd64 go build -ldflags \"-s -w\" -o /tmp/hyperfleet-hooks-linux-amd64 ./cmd/hyperfleet-hooks\n   gh release create v0.1.0 --repo openshift-hyperfleet/hyperfleet-hooks \\\n     --title \"v0.1.0\" --notes \"Release notes here\" \\\n     /tmp/hyperfleet-hooks-linux-amd64\n   ```\n\n   The binary is consumed by the Prow CI step (`hyperfleet-commitlint`) which downloads it directly from the GitHub release instead of compiling from source.\n\n3. Build and push the container image to quay.io:\n\n   ```bash\n   make image IMAGE_TAG=v0.1.0\n   make image-push IMAGE_TAG=v0.1.0\n   ```\n\n4. Verify the image is pullable:\n\n   ```bash\n   podman pull quay.io/openshift-hyperfleet/hyperfleet-git-hooks:v0.1.0\n   podman pull quay.io/openshift-hyperfleet/hyperfleet-git-hooks:latest\n   ```\n\n## License\n\nApache 2.0\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopenshift-hyperfleet%2Fhyperfleet-hooks","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fopenshift-hyperfleet%2Fhyperfleet-hooks","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopenshift-hyperfleet%2Fhyperfleet-hooks/lists"}