From f52cce2909e7e11d9f92a634289a46bf8c5a69f5 Mon Sep 17 00:00:00 2001 From: Robert Zaremba Date: Wed, 23 Sep 2020 17:29:21 +0200 Subject: [PATCH] Makefile: drop gofmt in favor of golangci-lint (#7260) * setup: update linter make jobs * go lint: remove wsl from golangci-lint config * rollback to use disable-all * bring back vendor rules * lint fails on golangci-lint error Co-authored-by: Alessio Treglia --- Makefile | 8 +++++--- x/staking/types/{test_utils.go => data_test.go} | 1 - 2 files changed, 5 insertions(+), 4 deletions(-) rename x/staking/types/{test_utils.go => data_test.go} (95%) diff --git a/Makefile b/Makefile index 605b320fb379..3e6e0600cf67 100644 --- a/Makefile +++ b/Makefile @@ -310,9 +310,11 @@ benchmark: ############################################################################### lint: - golangci-lint run --out-format=tab --issues-exit-code=0 - find . -name '*.go' -type f -not -path "./vendor*" -not -path "*.git*" -not -name '*.pb.go' | xargs gofmt -d -s -.PHONY: lint + golangci-lint run --out-format=tab + +lint-fix: + golangci-lint run --fix --out-format=tab --issues-exit-code=0 +.PHONY: lint lint-fix format: find . -name '*.go' -type f -not -path "./vendor*" -not -path "*.git*" -not -path "./client/docs/statik/statik.go" -not -path "./tests/mocks/*" -not -name '*.pb.go' | xargs gofmt -w -s diff --git a/x/staking/types/test_utils.go b/x/staking/types/data_test.go similarity index 95% rename from x/staking/types/test_utils.go rename to x/staking/types/data_test.go index 9ab8aabfe82c..377d7f8844e7 100644 --- a/x/staking/types/test_utils.go +++ b/x/staking/types/data_test.go @@ -7,7 +7,6 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" ) -// nolint:deadcode,unused var ( pk1 = ed25519.GenPrivKey().PubKey() pk2 = ed25519.GenPrivKey().PubKey()