dnephin/pre-commit-golang

go-imports doesn't work

jonyhy96 opened this issue · 4 comments

description

enviroment:

  • go1.13 darwin/amd64
  • pre-commit 1.18.3

.pre-commit-config.yaml:

repos:
- repo: git://github.com/dnephin/pre-commit-golang
  rev: v0.3.4
  hooks:
    - id: go-fmt
    - id: go-vet
    - id: go-imports
      exclude: 'vendor'
    - id: go-lint
    - id: go-critic
      exclude: 'vendor'
    - id: golangci-lint

error:

[ERROR] `go-imports` is not present in repository git://github.com/dnephin/pre-commit-golang.  Typo? Perhaps it is introduced in a newer version?  Often `pre-commit autoupdate` fixes this.
$ pre-commit autoupdate
Updating git://github.com/dnephin/pre-commit-golang...already up to date.

.pre-commit-config.yaml:

repos:
- repo: git://github.com/dnephin/pre-commit-golang
  rev: master
  hooks:
    - id: go-fmt
    - id: go-vet
    - id: go-imports
      exclude: 'vendor'
    - id: go-lint
    - id: go-critic
      exclude: 'vendor'
    - id: golangci-lint

errors:

[ERROR] `go-imports` is not present in repository git://github.com/dnephin/pre-commit-golang.  Typo? Perhaps it is introduced in a newer version?  Often `pre-commit autoupdate` fixes this.
$ pre-commit autoupdate
Updating git://github.com/dnephin/pre-commit-golang...Cannot update because the tip of master is missing these hooks:
go-imports

The configure bellow works.Maybe we should make another tag 😃

.pre-commit-config.yaml:

repos:
- repo: git://github.com/dnephin/pre-commit-golang
  rev: 6982e808a
  hooks:
    - id: go-fmt
    - id: go-vet
    - id: go-imports
      exclude: 'vendor'
    - id: go-lint
    - id: go-critic
      exclude: 'vendor'
    - id: golangci-lint

Tagged v0.3.5: https://github.com/dnephin/pre-commit-golang/releases/tag/v0.3.5

I guess it could have been v0.4.0, oh well