From e8892c4e9926a87460295e608a97b0c04dfb8187 Mon Sep 17 00:00:00 2001 From: Ian Howell Date: Thu, 20 Feb 2020 12:56:19 -0600 Subject: [PATCH] [#58] Add golint This adds the golint linter to the `make lint` target. As of this commit, the results from golint are not counted as errors. Further changes to the code will be required to bring it up to golint's standards, at which point we will allow golint to cause failures for the `lint` target. Change-Id: I34134e3deb080e6da0bc0aac299caca6c3b5d0a9 --- Makefile | 6 ++++++ go.sum | 1 + 2 files changed, 7 insertions(+) diff --git a/Makefile b/Makefile index 58203a326..17b69f6e4 100644 --- a/Makefile +++ b/Makefile @@ -81,6 +81,12 @@ lint: $(LINTER) @echo "Performing linting step..." @./tools/whitespace_linter @./$(LINTER) run --config $(LINTER_CONFIG) + @# NOTE(howell): golangci-lint uses and embedded golint, but if we use it, it + @# will cause gate failures. For now, we'll install golint alongside + @# golangci-lint. Once all of golint's suggestions have been fulfilled, we'll + @# remove this and simply use the golint that's embedded in golangci-lint. + @go install golang.org/x/lint/golint + @golint ./... @echo "Linting completed successfully" .PHONY: tidy diff --git a/go.sum b/go.sum index e0eb12bc3..c2cc9be1a 100644 --- a/go.sum +++ b/go.sum @@ -458,6 +458,7 @@ golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTk golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20190409202823-959b441ac422 h1:QzoH/1pFpZguR8NrRHLcO6jKqfv2zpuSqZLgdm7ZmjI= golang.org/x/lint v0.0.0-20190409202823-959b441ac422/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc=