Skip to content

ci: add pre-commit workflow#137

Closed
peter-svensson wants to merge 4 commits into
mainfrom
ci/add-pre-commit-workflow
Closed

ci: add pre-commit workflow#137
peter-svensson wants to merge 4 commits into
mainfrom
ci/add-pre-commit-workflow

Conversation

@peter-svensson
Copy link
Copy Markdown
Member

Summary

  • Add .github/workflows/pre-commit.yaml to run hooks from .pre-commit-config.yaml on PRs
  • Matches pattern in sibling opzkit modules (terraform-aws-aurora-postgresql, nodeamqp, etc.)
  • Includes setup-go (uses go.mod version) since hooks include go-mod-tidy, go-fumpt, golangci-lint

Test plan

  • PR check pre-commit runs and passes (or fails on real issues)
  • Action SHAs match other opzkit workflows so Renovate keeps them in sync

Run .pre-commit-config.yaml hooks on PRs (formatting, linters, gitleaks,
go-fumpt, golangci-lint). Aligns with other opzkit modules.
@opzkit-auto-merge opzkit-auto-merge Bot enabled auto-merge (squash) May 7, 2026 07:17
TekWizely/pre-commit-golang hooks invoke goimports, gofumpt and
golangci-lint as system binaries. Install them before running
pre-commit so go-imports, go-fumpt and golangci-lint-mod hooks pass.
- Makefile + pre-commit workflow: golangci-lint v1.62.2 -> v2.12.2
  (.golangci.yml uses v2 schema; v1 silently ignored excludes,
  causing G201/SA1019/ifElseChain to fire in CI)
- Pin gofumpt v0.10.0 and goimports v0.44.0 in workflow
- gofumpt fixes in internal/database/postgres.go,
  internal/controller/database_controller.go and
  test/integration/operator_test.go
- Refactor 3 if/else chains to switch in database_controller.go
  for clarity (now redundant since gocritic ifElseChain is excluded,
  but the switch form is cleaner regardless)
@peter-svensson peter-svensson requested a review from argoyle as a code owner May 7, 2026 07:36
auto-merge was automatically disabled May 7, 2026 07:40

Pull request was closed

@peter-svensson peter-svensson deleted the ci/add-pre-commit-workflow branch May 7, 2026 07:48
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.

1 participant