Skip to content

Commit 846c366

Browse files
henripqtdaveshanley
authored andcommitted
chore: add pre-commit hook
1 parent 80eb95d commit 846c366

2 files changed

Lines changed: 22 additions & 0 deletions

File tree

.pre-commit-config.yaml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# See https://pre-commit.com for more information
2+
# See https://pre-commit.com/hooks.html for more hooks
3+
repos:
4+
5+
# Run golangci-lint as a pre-commit hook to catch issues before they are pushed
6+
# See https://golangci-lint.run/ for more information
7+
- repo: local
8+
hooks:
9+
- id: golangci-lint
10+
name: Lint Go code
11+
entry: go tool golangci-lint run
12+
language: system
13+
pass_filenames: false
14+
types: [go]

README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,14 @@ go get github.com/pb33f/libopenapi-validator
3434
go run github.com/pb33f/libopenapi-validator/cmd/validate@latest [--regexengine] [--yaml2json] <file>
3535
```
3636

37+
## Install pre-commit hook
38+
39+
To install the pre-commit hook, run the following command in your terminal:
40+
41+
```bash
42+
pre-commit install
43+
```
44+
3745
### Options
3846

3947
#### --regexengine

0 commit comments

Comments
 (0)