pre-commit-golang icon indicating copy to clipboard operation
pre-commit-golang copied to clipboard

Golang hooks for pre-commit

Results 38 pre-commit-golang issues
Sort by recently updated
recently updated
newest added

If you change files in multiple directories, `go generate` will return an error. ``` named files must all be in one directory; have foo and bar ```

Changing how these hooks report their status for improving cross-platform support. In particular, this should fix #53 Additionally, I've set go-mod-tidy to run on changes to .mod and .sum files...

`go-unit-tests` hook runs the command `go test -tags=unit -timeout 30s -short -v` but what if I want go hook to run command with `-p 1` option. Is there any way...

[staticcheck](https://staticcheck.io/) hook

[staticcheck](https://github.com/dominikh/go-tools/tree/master/cmd/staticcheck) hook helps to find bugs and performance issues, offer simplifications, and enforce style rules.

when i use `v0.5.0` on MacOS i see the following error ``` go imports...............................................................Failed - hook id: go-imports - exit code: 127 /Users/***/.cache/pre-commit/repoi1qjadfc/run-go-imports.sh: line 8: goimports: command not found ```

I'd like to be able to pin to a specific commit without using a SHA. Conversely, the "autoupdate" feature of pre-commit by default [pulls the latest tag](https://pre-commit.com/#pre-commit-autoupdate). So for either...

This modifies run-go-unit-tests.sh to expose several "go test" command line options, including those related to code coverage. It is now possible to configure a hook like this: - repo: git://github.com/dnephin/pre-commit-golang...

```yaml # golang pre commits - repo: https://github.com/dnephin/pre-commit-golang rev: v0.4.0 hooks: - id: go-fmt - id: go-vet - id: go-lint - id: go-imports - id: no-go-testing - id: golangci-lint args:...

I have a directory containing only go testing files, for integration tests. I.e.: ``` src/ foo/ impl.go # for implementation impl_test.go # for unit tests test/ impl_test.go # for integration...