From ece4d1335caa3e7af03243d781cdc9cab8cff5e2 Mon Sep 17 00:00:00 2001 From: leo Date: Sat, 25 Feb 2023 19:10:38 +0100 Subject: [PATCH] pre-commit: use TekWizely/pre-commit-golang for Go --- .pre-commit-config.yaml | 28 +++++++--------------------- 1 file changed, 7 insertions(+), 21 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 12fa384..750bd02 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -8,6 +8,13 @@ repos: - repo: meta hooks: - id: check-hooks-apply + - repo: https://github.com/TekWizely/pre-commit-golang + rev: v1.0.0-rc.1 + hooks: + - id: go-mod-tidy + - id: go-test-mod + - id: golangci-lint-mod + - id: go-build-mod - repo: local hooks: - id: statix @@ -31,27 +38,6 @@ repos: pass_filenames: false files: "flake.(nix|lock)$" language: system - - id: go-mod-tidy - name: go-mod-tidy - entry: bash -c 'cd ./p2 && go mod tidy' - files: '\.(go|mod|sum)$' - language: system - - id: go-unit-tests - name: go-unit-tests - entry: bash -c "cd ./p2 && go test -v ./..." - files: '\.go$' - language: system - - id: golangci-lint - name: golangci-lint - entry: bash -c 'cd p2 && golangci-lint run' - # types: [go] - pass_filenames: false - language: system - - id: go-build - name: go-build - entry: bash -c 'cd ./p2 && go build -v .' - language: system - - id: nix-build-py name: nix build py entry: nix build .#p1