Skip to content

pre-commit hook config #188

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
pre-commit hook config
added `.pre-commit-config.yaml` to the repo. To use it:

- `pip install pre-commit`
- Install the following Go packages:
  * go install github.com/go-critic/go-critic/cmd/gocritic@latest
  * go install https://pkg.go.dev/golang.org/x/tools/cmd/goimports@latest
  * go install golang.org/x/lint/golint@latest
- In your clone, run: `pre-commit install`

This will create .git/hooks/pre-commit and following that, these tests will run every time you invoke `git commit`:
```sh
go fmt...................................................................Passed
go imports...............................................................Passed
go vet...................................................................Passed
go lint..................................................................Passed
go-critic................................................................Passed
```
  • Loading branch information
jessp01 committed Aug 23, 2023
commit 006c6f5647c5e1e0890f48e1fef6e57e83afda82
11 changes: 11 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
repos:
- repo: https://github.com/jessp01/pre-commit-golang.git
rev: v0.5.7
hooks:
- id: go-fmt
- id: go-imports
- id: go-vet
- id: go-lint
- id: go-critic
- id: go-ineffassign
- id: shellcheck