Skip to content

Comments

docs: adding pre-commit functionality#97

Merged
amdove merged 5 commits intomainfrom
pre-commit
Feb 23, 2026
Merged

docs: adding pre-commit functionality#97
amdove merged 5 commits intomainfrom
pre-commit

Conversation

@amdove
Copy link
Contributor

@amdove amdove commented Feb 20, 2026

Summary

Adds pre-commit hooks to automate code quality checks and manifest generation.

Hooks

Hook Triggers On
format All commits
vet Changed .go files only
mgenerate api/**/*.go
helm-generate config/**
helm-lint dist/chart/**
helm-template dist/chart/**

Changes

  • .pre-commit-config.yaml - New file with 6 hooks
  • Justfile
    • Added install-git-hooks recipe (runs uvx pre-commit install)
    • Added vet recipe (go vet ./...)
    • deps now runs install-git-hooks automatically
  • CONTRIBUTING.md
    • Added Git Hooks section with hook table
    • Added bypass instructions (--no-verify, SKIP=)

Setup

just deps  # or: just install-git-hooks

Test plan

  • make helm-lint passes
  • make helm-template renders cleanly
  • make helm-generate is idempotent (zero diff on re-run)
  • Deploy to staging cluster with adhoc image and verify operator starts
  • Update PTD Pulumi code to use new values structure (separate PR)

@claude
Copy link

claude bot commented Feb 20, 2026

Claude finished @amdove's task —— View job


Review of PR #97: Adding pre-commit functionality

Overall this is a clean, well-structured addition. Four items worth addressing:


1. go vet with pass_filenames: true (.pre-commit-config.yaml:10-15)

The vet hook calls go vet directly with pass_filenames: true, but go vet expects package patterns, not individual file paths. When pre-commit passes individual .go files, this can produce unexpected behavior. Since a just vet target was added in this PR, consider using it for consistency with all the other hooks:

      - id: vet
        name: Go vet
        entry: just vet
        language: system
        pass_filenames: false
        files: \.go$

2. helm-lint/helm-template won't fire after helm-generate (.pre-commit-config.yaml:31-43)

The helm-lint and helm-template hooks only trigger on ^dist/chart/ changes, but helm-generate runs on ^config/ changes and outputs into dist/chart/. In a single commit touching only config/ files, helm-generate will fire but helm-lint and helm-template won't, because the staged files are in config/, not dist/chart/.

Consider either adding ^config/ to the files pattern for the lint/template hooks, or documenting that contributors should run uvx pre-commit run --all-files after config changes.

3. SKIP=test examples reference a non-existent hook (CONTRIBUTING.md:80-81)

The SKIP examples use test as a hook id, but no hook with id test exists in .pre-commit-config.yaml. Use an actual hook id so the examples are accurate:

SKIP=vet git commit -m "message"
SKIP=vet,mgenerate git commit -m "message"

4. deps depending on install-git-hooks may break CI (Justfile:18)

Making deps depend on install-git-hooks means just deps will fail in environments without uvx installed (CI runners, Docker builds, new contributors without uv). Consider either:

  • Keeping install-git-hooks as a standalone target (not a dependency of deps)
  • Making it fault-tolerant with the - prefix: -uvx pre-commit install (ignores errors)
  • Adding uvx/uv to the prerequisites list in CONTRIBUTING.md

Copy link

@claude claude bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review of pre-commit hook setup — see detailed feedback in the PR comment below.

@amdove amdove marked this pull request as ready for review February 23, 2026 16:10
@amdove amdove added this pull request to the merge queue Feb 23, 2026
Merged via the queue into main with commit 8dc90b0 Feb 23, 2026
4 checks passed
@amdove amdove deleted the pre-commit branch February 23, 2026 16:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants