-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.pre-commit-config.yaml
35 lines (35 loc) · 1.16 KB
/
.pre-commit-config.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.3.0
hooks:
- id: trailing-whitespace # handle any whitespace of the end of line and the new line.
- id: end-of-file-fixer # remove EOF of your whole files project.
files: \.go$
- id: check-yaml # fix yaml format file.
- id: check-added-large-files # let you know which file has large file size.
- repo: https://github.com/dnephin/pre-commit-golang
rev: v0.5.1
hooks:
- id: go-mod-tidy # run go mod tidy -v.
- repo: https://github.com/golangci/golangci-lint # golangci-lint hook repo
rev: v1.54.2 # golangci-lint hook repo revision
hooks:
- id: golangci-lint
stages: [ pre-commit ]
language_version: 1.20.14
- repo: local
hooks:
- id: go-unit-tests
name: go-unit-tests
description: run go tests with race detector
entry: go test -v -race ./...
language: golang
files: \.*$
pass_filenames: false
- id: typos
name: typos
description: check typo
entry: bash -c 'typos'
language: golang
files: \.*$
pass_filenames: false