https://github.com/mrsimonemms/pre-commit-hooks
Reusable pre-commit hooks
https://github.com/mrsimonemms/pre-commit-hooks
continuous-integration linting pre-commit pre-commit-hooks
Last synced: 3 months ago
JSON representation
Reusable pre-commit hooks
- Host: GitHub
- URL: https://github.com/mrsimonemms/pre-commit-hooks
- Owner: mrsimonemms
- License: apache-2.0
- Created: 2023-08-15T20:44:51.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2025-02-16T19:44:35.000Z (about 1 year ago)
- Last Synced: 2025-03-05T22:51:58.627Z (about 1 year ago)
- Topics: continuous-integration, linting, pre-commit, pre-commit-hooks
- Language: Makefile
- Homepage:
- Size: 21.5 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# pre-commit-hooks
Reusable pre-commit hooks
* [Hooks](#hooks)
* [Go Err Check](#go-err-check)
* [Go Fumpt](#go-fumpt)
* [Go Fmt Import](#go-fmt-import)
* [Go Static Check](#go-static-check)
* [Go Vet](#go-vet)
* [License-Eye](#license-eye)
* [Packer Format](#packer-format)
* [Packer Validate](#packer-validate)
* [Contributing](#contributing)
* [Open in a container](#open-in-a-container)
## Hooks
### Go Err Check
> Go-ified version of hook in [Bahjat's project](https://github.com/Bahjat/pre-commit-golang)
```yaml
repos:
- repo: https://github.com/mrsimonemms/pre-commit-hooks
rev: "" # Use the ref you want to point at
hooks:
- id: go-err-check
```
Use [kisielk/errcheck](https://github.com/kisielk/errcheck) to check that you
checked errors
### Go Fumpt
> Go-ified version of hook in [Bahjat's project](https://github.com/Bahjat/pre-commit-golang)
```yaml
repos:
- repo: https://github.com/mrsimonemms/pre-commit-hooks
rev: "" # Use the ref you want to point at
hooks:
- id: gofumpt
```
Use [mvdan/gofumpt](https://github.com/mvdan/gofumpt) to check your Go formatting
### Go Fmt Import
> Go-ified version of hook in [Bahjat's project](https://github.com/Bahjat/pre-commit-golang)
```yaml
repos:
- repo: https://github.com/mrsimonemms/pre-commit-hooks
rev: "" # Use the ref you want to point at
hooks:
- id: go-fmt-import
```
Use [goimports](https://pkg.go.dev/golang.org/x/tools/cmd/goimports) to format
your import statementstps://github.com/mvdan/gofumpt) to check your Go formatting
### Go Static Check
> Go-ified version of hook in [Bahjat's project](https://github.com/Bahjat/pre-commit-golang)
```yaml
repos:
- repo: https://github.com/mrsimonemms/pre-commit-hooks
rev: "" # Use the ref you want to point at
hooks:
- id: go-static-check
```
Use [staticcheck](https://staticcheck.dev) to lint your Go code
### Go Vet
> Go-ified version of hook in [Bahjat's project](https://github.com/Bahjat/pre-commit-golang)
```yaml
repos:
- repo: https://github.com/mrsimonemms/pre-commit-hooks
rev: "" # Use the ref you want to point at
hooks:
- id: go-vet
```
Use [go vet](https://pkg.go.dev/cmd/vet) to check your Go code
### License-Eye
```yaml
repos:
- repo: https://github.com/mrsimonemms/pre-commit-hooks
rev: "" # Use the ref you want to point at
hooks:
- id: license-eye
```
Add [SkyWalking-Eyes](https://github.com/apache/skywalking-eyes) and check that
the files have the correct headers implemented.
### Packer Format
```yaml
repos:
- repo: https://github.com/mrsimonemms/pre-commit-hooks
rev: "" # Use the ref you want to point at
hooks:
- id: packer-fmt
```
Run [Packer fmt](https://developer.hashicorp.com/packer/docs/commands/fmt)
command.
### Packer Validate
```yaml
repos:
- repo: https://github.com/mrsimonemms/pre-commit-hooks
rev: "" # Use the ref you want to point at
hooks:
- id: packer-validate
```
Run [Packer validate](https://developer.hashicorp.com/packer/docs/commands/validate)
command.
## Contributing
### Open in a container
* [Open in a container](https://code.visualstudio.com/docs/devcontainers/containers)