Skip to content

Commit

Permalink
gci linter is no longer working with golangci-lint. Calling gci direc…
Browse files Browse the repository at this point in the history
…tly from Makefile for now.

Co-authored-by: Marty Spiewak <[email protected]>
  • Loading branch information
emmjohnson and Marty Spiewak committed Mar 3, 2022
1 parent 842f62d commit 6d20d0e
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 2 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ CONTROLLER_GEN ?= go run -modfile hack/tools/go.mod sigs.k8s.io/controller-tools
ADDLICENSE ?= go run -modfile hack/tools/go.mod github.com/google/addlicense
GOLANGCI_LINT ?= go run -modfile hack/tools/go.mod github.com/golangci/golangci-lint/cmd/golangci-lint
GINKGO ?= go run -modfile hack/tools/go.mod github.com/onsi/ginkgo/ginkgo
GCI_LINT ?= go run -modfile hack/tools/go.mod github.com/daixiang0/gci

ifndef ($LOG_LEVEL)
# set a default LOG_LEVEL whenever we run the controller
Expand Down Expand Up @@ -126,6 +127,7 @@ coverage:

.PHONY: lint
lint: copyright
$(GCI_LINT) --local github.com/vmware-tanzu/cartographer --write $$(find ./pkg ! -name "fake_*" -type f)
$(GOLANGCI_LINT) --config lint-config.yaml run
$(MAKE) -C hack lint

Expand Down
2 changes: 1 addition & 1 deletion hack/tools/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ module github.com/vmware-tanzu/cartographer/hack/tools
go 1.17

require (
github.com/daixiang0/gci v0.3.1-0.20220208004058-76d765e3ab48
github.com/golangci/golangci-lint v1.44.2
github.com/google/addlicense v1.0.0
github.com/maxbrunsfeld/counterfeiter/v6 v6.4.1
Expand Down Expand Up @@ -32,7 +33,6 @@ require (
github.com/cespare/xxhash/v2 v2.1.2 // indirect
github.com/charithe/durationcheck v0.0.9 // indirect
github.com/chavacava/garif v0.0.0-20210405164556-e8a0a408d6af // indirect
github.com/daixiang0/gci v0.3.1-0.20220208004058-76d765e3ab48 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/denis-tingajkin/go-header v0.4.2 // indirect
github.com/esimonov/ifshort v1.0.4 // indirect
Expand Down
1 change: 1 addition & 0 deletions hack/tools/tools.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
package tools

import (
_ "github.com/daixiang0/gci"
_ "github.com/golangci/golangci-lint/cmd/golangci-lint"
_ "github.com/google/addlicense"
_ "github.com/maxbrunsfeld/counterfeiter/v6"
Expand Down
3 changes: 0 additions & 3 deletions lint-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,9 @@

linters:
enable:
- gci
- govet

linters-settings:
gci:
local-prefixes: github.com/vmware-tanzu/cartographer
govet:
disable:
- composites
Expand Down

0 comments on commit 6d20d0e

Please sign in to comment.