Skip to content

Commit

Permalink
ci: add pre-commit hooks
Browse files Browse the repository at this point in the history
  • Loading branch information
wbollock committed Mar 6, 2023
1 parent fa5b37a commit c2a052b
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 0 deletions.
35 changes: 35 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
repos:
- repo: https://github.com/tekwizely/pre-commit-golang
rev: v1.0.0-rc.1
hooks:
#
# Go Build
#
- id: go-build-mod
- id: go-build-repo-mod
#
# Go Mod Tidy
#
- id: go-mod-tidy
- id: go-mod-tidy-repo
#
# Go Test
#
- id: go-test-mod
- id: go-test-repo-mod
#
# Formatters
#
- id: go-fmt
- id: go-fmt-repo
#
#
# GolangCI-Lint
# - Fast Multi-Linter
# - Can be configured to replace MOST other hooks
# - Supports repo config file for configuration
# - https://github.com/golangci/golangci-lint
#
- id: golangci-lint
- id: golangci-lint-mod
- id: golangci-lint-repo-mod
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,12 @@ ssh root@<nagiosXI-VM-ip>
curl -s localhost:9927/metrics | grep "^nagios"
```

Install pre-commit hooks:

```console
pre-commit install
```

## Releasing

Follow goreleaser's [quick start](https://goreleaser.com/quick-start/) instructions.
Expand Down

0 comments on commit c2a052b

Please sign in to comment.