From eb10a2c276401ce0a1e1631f9a8ab21f5eba892a Mon Sep 17 00:00:00 2001 From: "F." Date: Mon, 12 Jan 2026 15:34:37 +0100 Subject: [PATCH 1/2] ci(pre-commit): streamline hook set by removing gitleaks, hadolint, and JSON/req fixers - remove hooks: check-json, pretty-format-json (excluded cspell.json), requirements-txt-fixer - drop gitleaks and hadolint hooks - keep core whitespace fixers and strict yamllint; cspell CLI remains --- .pre-commit-ci-config.yaml | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/.pre-commit-ci-config.yaml b/.pre-commit-ci-config.yaml index 16986a2..2c55bca 100644 --- a/.pre-commit-ci-config.yaml +++ b/.pre-commit-ci-config.yaml @@ -3,9 +3,6 @@ repos: - repo: https://github.com/pre-commit/pre-commit-hooks rev: v6.0.0 hooks: - - id: check-json - - id: pretty-format-json - exclude: cspell.json - id: end-of-file-fixer - id: mixed-line-ending - id: trailing-whitespace @@ -16,11 +13,6 @@ repos: files: .*\.(yaml|yml)$ exclude: mkdocs.yml args: [--allow-multiple-documents] - - id: requirements-txt-fixer - - repo: https://github.com/gitleaks/gitleaks - rev: v8.30.0 - hooks: - - id: gitleaks - repo: https://github.com/adrienverge/yamllint.git rev: v1.37.1 hooks: @@ -28,10 +20,6 @@ repos: files: \.(yaml|yml)$ types: [file, yaml] entry: yamllint --strict -f parsable - - repo: https://github.com/hadolint/hadolint - rev: v2.14.0 - hooks: - - id: hadolint-docker - repo: https://github.com/streetsidesoftware/cspell-cli rev: v9.4.0 hooks: From 0f1dc6f250b49c97c1c5997c064fa6ae18323afb Mon Sep 17 00:00:00 2001 From: "F." Date: Mon, 12 Jan 2026 16:01:31 +0100 Subject: [PATCH 2/2] ci(go): add GitHub Actions build workflow; drop local pre-commit hooks - Add .github/workflows/go.yml to build on PRs and pushes to main. - Load project settings from .project-settings.env (GO_VERSION, GCI_PREFIX default github.com/hyp3rd/starter, GOLANGCI_LINT_VERSION, PROTO_ENABLED). - Set up Go via actions/setup-go@v6.1.0; cache modules; run `go mod download`, `go mod tidy` (with diff check), `go mod verify`, and `go build -v ./...`. - Remove local `go-verify` and `gci` hooks from `.pre-commit-ci-config.yaml` to simplify local tooling. Why: enforce module hygiene and builds in CI while reducing reliance on local hooks. --- .github/workflows/go.yml | 53 ++++++++++++++++++++++++++++++++++++++ .pre-commit-ci-config.yaml | 12 --------- 2 files changed, 53 insertions(+), 12 deletions(-) create mode 100644 .github/workflows/go.yml diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml new file mode 100644 index 0000000..2f05cc5 --- /dev/null +++ b/.github/workflows/go.yml @@ -0,0 +1,53 @@ +--- +name: Go + +on: + pull_request: + push: + branches: [main] + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v6 + - name: Load project settings + id: settings + run: | + set -a + source .project-settings.env + set +a + echo "go_version=${GO_VERSION}" >> "$GITHUB_OUTPUT" + echo "gci_prefix=${GCI_PREFIX:-github.com/hyp3rd/starter}" >> "$GITHUB_OUTPUT" + echo "golangci_lint_version=${GOLANGCI_LINT_VERSION}" >> "$GITHUB_OUTPUT" + echo "proto_enabled=${PROTO_ENABLED:-true}" >> "$GITHUB_OUTPUT" + + - name: Set up Go + uses: actions/setup-go@v6.1.0 + with: + go-version: "${{ steps.settings.outputs.go_version }}" + check-latest: true + + - name: Cache Go modules + uses: actions/cache@v5 + with: + path: | + ~/go/pkg/mod + ~/.cache/go-build + key: ${{ runner.os }}-go-${{ steps.settings.outputs.go_version }}-${{ hashFiles('**/go.sum') }} + restore-keys: | + ${{ runner.os }}-go-${{ steps.settings.outputs.go_version }}- + + - name: Modules download + run: go mod download + + - name: Tidy check + run: | + go mod tidy + git diff --exit-code go.mod go.sum + + - name: Verify + run: go mod verify + + - name: Build + run: go build -v ./... diff --git a/.pre-commit-ci-config.yaml b/.pre-commit-ci-config.yaml index 2c55bca..e54fbb8 100644 --- a/.pre-commit-ci-config.yaml +++ b/.pre-commit-ci-config.yaml @@ -45,15 +45,3 @@ repos: entry: mdl language: ruby files: \.(md|mdown|markdown)$ - - repo: local - hooks: - - id: go-verify - name: go-verify - language: system - entry: ./.pre-commit/go-mod-hook - require_serial: true - - id: gci - name: gci - language: system - entry: ./.pre-commit/gci-hook - require_serial: true