From 28a5fdf48e623fc8f24e7f185a87ebeb18ab2d4d Mon Sep 17 00:00:00 2001 From: Joakim Olsson Date: Fri, 13 Jan 2023 13:44:33 +0100 Subject: [PATCH] ci: add local module to pre-commit config --- .gitlab-ci.yml | 7 +------ .pre-commit-config.yaml | 20 +++++++++++--------- 2 files changed, 12 insertions(+), 15 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index cbb97d5..2d675b9 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -20,7 +20,7 @@ variables: run-pre-commit: stage: .pre - image: golang:1.19 + image: unbound/pre-commit variables: PRE_COMMIT_HOME: ${CI_PROJECT_DIR}/.cache/pre-commit cache: @@ -29,11 +29,6 @@ run-pre-commit: - .pre-commit-config.yaml paths: - ${PRE_COMMIT_HOME} - before_script: - - apt update && apt install -y python3 python3-pip ruby git - - go install github.com/lietu/go-pre-commit@latest - - curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.49.0 - - pip install pre-commit script: - pre-commit run --all-files diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 1136595..af45b84 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -24,16 +24,18 @@ repos: - id: commitlint stages: [ commit-msg ] additional_dependencies: [ '@commitlint/config-conventional' ] -- repo: https://github.com/lietu/go-pre-commit - rev: v0.0.1 - hooks: - - id: errcheck - - id: go-fmt-goimports - - id: go-test - - id: golangci-lint - - id: gofumpt - - id: staticcheck - repo: https://github.com/dnephin/pre-commit-golang rev: v0.5.1 hooks: - id: go-mod-tidy + - id: go-imports + args: + - -local + - gitlab.com/unboundsoftware/schemas +- repo: https://github.com/lietu/go-pre-commit + rev: v0.0.1 + hooks: + - id: go-test + - id: golangci-lint + - id: gofumpt +exclude: '^graph/generated/.*$|^graph/model/models_gen.go|^tools/.*$$'