Skip to content

Commit 306ba33

Browse files
cheina97adamjensenbot
authored andcommitted
Added pre-commit hook configuration
1 parent 368f31d commit 306ba33

File tree

3 files changed

+22
-2
lines changed

3 files changed

+22
-2
lines changed

.github/workflows/lint.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
uses: golangci/[email protected]
2525
with:
2626
only-new-issues: true
27-
version: v1.54.2
27+
version: v1.55.1
2828
args: --timeout=900s
2929

3030
gomodtidy:

.pre-commit-config.yaml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# See https://pre-commit.com for more information
2+
# See https://pre-commit.com/hooks.html for more hooks
3+
repos:
4+
- repo: https://github.com/golangci/golangci-lint
5+
rev: v1.55.1
6+
hooks:
7+
- id: golangci-lint
8+
name: golangci-lint
9+
description: Fast linters runner for Go.
10+
entry: golangci-lint run --new
11+
types: [go]
12+
language: golang
13+
require_serial: true
14+
pass_filenames: false
15+
fail_fast: true

Makefile

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,12 +104,17 @@ fmt: gci addlicense
104104
# Install golangci-lint if not available
105105
golangci-lint:
106106
ifeq (, $(shell which golangci-lint))
107-
@go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.54.2
107+
@go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.55.1
108108
GOLANGCILINT=$(GOBIN)/golangci-lint
109109
else
110110
GOLANGCILINT=$(shell which golangci-lint)
111111
endif
112112

113+
# pre-commit install the pre-commit hook
114+
pre-commit:
115+
pip3 install pre-commit
116+
pre-commit install
117+
113118
markdownlint:
114119
ifeq (, $(shell which markdownlint))
115120
@echo "markdownlint is not installed. Please install it: https://github.com/igorshubovych/markdownlint-cli#installation"

0 commit comments

Comments
 (0)