Skip to content

Commit

Permalink
Added pre-commit hook configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
cheina97 authored and adamjensenbot committed Oct 31, 2023
1 parent 368f31d commit 306ba33
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
uses: golangci/golangci-lint-action@v3.7.0
with:
only-new-issues: true
version: v1.54.2
version: v1.55.1
args: --timeout=900s

gomodtidy:
Expand Down
15 changes: 15 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
repos:
- repo: https://github.com/golangci/golangci-lint
rev: v1.55.1
hooks:
- id: golangci-lint
name: golangci-lint
description: Fast linters runner for Go.
entry: golangci-lint run --new
types: [go]
language: golang
require_serial: true
pass_filenames: false
fail_fast: true
7 changes: 6 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -104,12 +104,17 @@ fmt: gci addlicense
# Install golangci-lint if not available
golangci-lint:
ifeq (, $(shell which golangci-lint))
@go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.54.2
@go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.55.1
GOLANGCILINT=$(GOBIN)/golangci-lint
else
GOLANGCILINT=$(shell which golangci-lint)
endif

# pre-commit install the pre-commit hook
pre-commit:
pip3 install pre-commit
pre-commit install

markdownlint:
ifeq (, $(shell which markdownlint))
@echo "markdownlint is not installed. Please install it: https://github.com/igorshubovych/markdownlint-cli#installation"
Expand Down

0 comments on commit 306ba33

Please sign in to comment.