Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
7 changes: 6 additions & 1 deletion .github/README.md.header
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# golang-pre-commit

This is a collection of golang [pre-commit](http://pre-commit.com/) hooks.
This is a collection of golang [pre-commit](http://pre-commit.com/) hooks
specifcally for build, generate, unit tests, and other build-time workflow
checks.

If you need a pre-commit for a linter or formatter, check out the official
[golangci-lint](https://golangci-lint.run/) pre-commit: https://github.com/golangci/golangci-lint/blob/main/.pre-commit-hooks.yaml
2 changes: 1 addition & 1 deletion .github/workflows/update-readme.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ jobs:
echo -ne ' - repo: https://github.com/bhundven/golang-pre-commit.git\n' >&3
echo -ne " rev: ${LATEST_VER}\n" >&3
echo -ne ' hooks:\n' >&3
echo -ne ' - id: go-fmt\n' >&3
echo -ne ' - id: go-generate\n' >&3
echo -ne '```\n\n' >&3

echo -ne "## Available Hooks\n\n" >&3
Expand Down
56 changes: 0 additions & 56 deletions .pre-commit-hooks.yaml
Original file line number Diff line number Diff line change
@@ -1,60 +1,4 @@
---
- id: go-fmt
name: 'gofmt'
entry: pre-commit-hooks/gofmt.sh
types: [go]
exclude: '(^|/)vendor/'
language: 'script'
description: "Runs `gofmt`. Requires golang: https://go.dev/doc/install"
pass_filenames: true
- id: go-fumpt
name: 'gofumpt'
entry: pre-commit-hooks/go-fumpt.sh
types: [go]
exclude: '(^|/)vendor/'
language: 'script'
description: "Runs `gofumpt`. Requires gofumpt: https://github.com/mvdan/gofumpt"
pass_filenames: true
- id: go-imports
name: 'goimports'
entry: pre-commit-hooks/go-imports.sh
types: [go]
exclude: '(^|/)vendor/'
language: 'script'
description: "Runs `goimports`. Requires goimports: https://pkg.go.dev/golang.org/x/tools/cmd/goimports"
pass_filenames: true
- id: go-vet
name: 'go vet'
entry: pre-commit-hooks/go-vet.sh
types: [go]
exclude: '(^|/)vendor/'
language: 'script'
description: "Runs `go vet`. Requires golang: https://go.dev/doc/install"
pass_filenames: true
- id: go-lint
name: 'golint'
entry: pre-commit-hooks/go-lint.sh
types: [go]
exclude: '(^|/)vendor/'
language: 'script'
description: "[DEPRECATED] Runs `golint`. Requires golint: https://github.com/golang/lint"
pass_filenames: true
- id: golangci-lint
name: 'golangci-lint'
entry: pre-commit-hooks/golangci-lint.sh
types: [go]
exclude: '(^|/)vendor/'
language: 'script'
description: "Runs `golangci-lint`. Requires golangci-lint: https://github.com/golangci/golangci-lint"
pass_filenames: true
- id: go-critic
name: "gocritic"
entry: pre-commit-hooks/go-critic.sh
types: [go]
exclude: '(^|/)vendor/'
language: 'script'
description: "Runs `gocritic`. Requires gocritic: https://github.com/go-critic/go-critic"
pass_filenames: true
- id: go-unit-tests
name: 'go test'
entry: pre-commit-hooks/go-unit-tests.sh
Expand Down
20 changes: 0 additions & 20 deletions pre-commit-hooks/go-critic.sh

This file was deleted.

16 changes: 0 additions & 16 deletions pre-commit-hooks/go-fumpt.sh

This file was deleted.

16 changes: 0 additions & 16 deletions pre-commit-hooks/go-imports.sh

This file was deleted.

20 changes: 0 additions & 20 deletions pre-commit-hooks/go-lint.sh

This file was deleted.

11 changes: 0 additions & 11 deletions pre-commit-hooks/go-vet.sh

This file was deleted.

15 changes: 0 additions & 15 deletions pre-commit-hooks/gofmt.sh

This file was deleted.

14 changes: 0 additions & 14 deletions pre-commit-hooks/golangci-lint.sh

This file was deleted.