ci: add checking of pre-commit rules

This commit is contained in:
2022-09-30 23:46:11 +02:00
parent cfb7cc4f2f
commit 757dbe4349
2 changed files with 20 additions and 4 deletions
+19
View File
@@ -9,6 +9,25 @@ variables:
image: buildtool/build-tools:${BUILDTOOLS_VERSION}
run-pre-commit:
stage: .pre
image: golang:1.19
variables:
PRE_COMMIT_HOME: ${CI_PROJECT_DIR}/.cache/pre-commit
cache:
- key:
files:
- .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
build:
stage: build
services:
+1 -4
View File
@@ -12,10 +12,6 @@ repos:
rev: 3.0.0
hooks:
- id: markdownlint
- repo: https://github.com/golangci/golangci-lint
rev: v1.49.0
hooks:
- id: golangci-lint
- repo: https://gitlab.com/devopshq/gitlab-ci-linter
rev: v1.0.3
hooks:
@@ -33,5 +29,6 @@ repos:
- id: go-fmt-goimports
- id: go-test
- id: go-vet
- id: golangci-lint
- id: gofumpt
- id: staticcheck