Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/bahjat/pre-commit-golang
Golang pre-commit hooks for http://pre-commit.com/
https://github.com/bahjat/pre-commit-golang
go pre-commit precommit-hooks shell
Last synced: 3 months ago
JSON representation
Golang pre-commit hooks for http://pre-commit.com/
- Host: GitHub
- URL: https://github.com/bahjat/pre-commit-golang
- Owner: Bahjat
- License: mit
- Created: 2019-08-02T15:08:17.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2024-04-16T07:18:03.000Z (10 months ago)
- Last Synced: 2024-06-18T23:09:33.980Z (8 months ago)
- Topics: go, pre-commit, precommit-hooks, shell
- Language: Shell
- Homepage:
- Size: 20.5 KB
- Stars: 66
- Watchers: 2
- Forks: 16
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# pre-commit-golang
Golang pre-commit hooks for http://pre-commit.com/
## install
you need first to install [pre-commit](https://pre-commit.com/#install)
```
brew install pre-commit
```install pre-commit into your git repo
```
pre-commit install
```## Usage
Add a file named `.pre-commit-config.yaml` into the root directory of your repository
```yaml
repos:
- repo: https://github.com/Bahjat/pre-commit-golang
rev: v1.0.2
hooks:
- id: go-fmt-import
- id: go-vet
- id: go-lint
- id: go-unit-tests
- id: gofumpt # requires github.com/mvdan/gofumpt
- id: go-err-check # requires github.com/kisielk/errcheck
- id: go-static-check # install https://staticcheck.io/docs/
- id: golangci-lint # requires github.com/golangci/golangci-lint
args: [--config=.github/linters/.golangci.yml] # optional
- id: go-ruleguard # requires https://github.com/quasilyte/go-ruleguard
args: [rules/rules.go] # required
```## Contributing
- Fork it
- Create your feature branch `git checkout -b my-new-feature`
- Commit your changes `git commit -am 'Add some feature'`
- Push to the branch `git push origin my-new-feature`
- Create new Pull Request## Credits
This repo is inspired by [dnephin/pre-commit-golang](https://github.com/dnephin/pre-commit-golang)
## Finally
If you like this hooks please give a star