forked from emissary-ingress/emissary
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
(from AES) CI: Add a job to check that Go code is formatted with `gof…
…mt -s`
- Loading branch information
Showing
7 changed files
with
594 additions
and
111 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
# Start with a very conservative configuration, and slowly turn things | ||
# back on. | ||
linters: | ||
disable-all: true | ||
enable: | ||
- gofmt | ||
linters-settings: | ||
gofmt: | ||
simplify: true | ||
|
||
# The old configuration, that hasn't been used for many months: | ||
|
||
#linters: | ||
# enable-all: true | ||
# disable: | ||
# - errcheck | ||
# - gochecknoglobals | ||
# - gochecknoinits | ||
# - golint | ||
# - interfacer # author says it's deprecated, gives very subjective advice | ||
# - lll | ||
# - maligned | ||
# - prealloc | ||
# - scopelint | ||
# - stylecheck | ||
# - unparam | ||
# - unused # confused by dev-portal-server, for some reason | ||
#linters-settings: | ||
# unused: | ||
# # treat code as a program (not a library) and report unused | ||
# # exported identifiers | ||
# check-exported: true | ||
# goimports: | ||
# # put imports beginning with prefix after 3rd-party packages; | ||
# # it's a comma-separated list of prefixes | ||
# local-prefixes: github.com/datawire/apro,github.com/lyft/ratelimit | ||
# depguard: | ||
# list-type: blacklist | ||
# include-go-root: true | ||
# packages: | ||
# - errors # use "github.com/pkg/errors" | ||
# - golang.org/x/net/context # use "context" | ||
# - github.com/datawire/teleproxy # use "github.com/datawire/ambassador/pkg" | ||
# - github.com/datawire/ambassador/go # use "github.com/datawire/ambassador/pkg" | ||
# - github.com/datawire/kat-backend/xds # use "github.com/datawire/ambassador/pkg/api/envoy" | ||
# - github.com/lyft/ratelimit/proto # use "github.com/datawire/ambassador/pkg/api/envoy" | ||
# #- github.com/russross/blackfriday # use "github.com/russross/blackfriday/v2" # can't turn off prefix-matching | ||
# - gopkg.in/russross/blackfriday.v2 # use "github.com/russross/blackfriday/v2" | ||
# goconst: | ||
# min-len: 12 | ||
#issues: | ||
# new-from-rev: a72c53cbcd05c806b1838d95146d049b09a51ffb | ||
#run: | ||
# build-tags: | ||
# - test | ||
# - integration | ||
# - lint |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# Must be included *after* generate.mk, because we use GOHOSTOS and GOHOSTARCH defined there. | ||
|
||
# The version number of golangci-lint is controllers in a go.mod file | ||
tools/golangci-lint = $(OSS_HOME)/bin_$(GOHOSTOS)_$(GOHOSTARCH)/golangci-lint | ||
$(tools/golangci-lint): $(OSS_HOME)/build-aux/bin-go/golangci-lint/go.mod | ||
mkdir -p $(@D) | ||
cd $(<D) && go build -o $@ github.com/golangci/golangci-lint/cmd/golangci-lint | ||
|
||
lint/go-dirs = $(OSS_HOME) | ||
|
||
lint: $(tools/golangci-lint) | ||
@PS4=; set -x; r=0; { \ | ||
for dir in $(lint/go-dirs); do \ | ||
(cd $$dir && $(tools/golangci-lint) run ./...) || r=$?; \ | ||
done; \ | ||
exit $$r; \ | ||
} | ||
.PHONY: lint | ||
|
||
format: $(tools/golangci-lint) | ||
@PS4=; set -x; { \ | ||
for dir in $(lint/go-dirs); do \ | ||
(cd $$dir && $(tools/golangci-lint) run ./...) || true; \ | ||
exit $$r; \ | ||
} | ||
.PHONY: format |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,5 @@ | ||
module github.com/datawire/build-aux/bin-go/golangci-lint | ||
|
||
go 1.12 | ||
go 1.15 | ||
|
||
require github.com/golangci/golangci-lint v1.17.1 | ||
|
||
// Fix incorrect timestamps that Go 1.13 complains about. | ||
replace ( | ||
github.com/go-critic/go-critic v0.0.0-20181204210945-1df300866540 => github.com/go-critic/go-critic v0.0.0-20190526074819-1df300866540 | ||
github.com/golangci/errcheck v0.0.0-20181003203344-ef45e06d44b6 => github.com/golangci/errcheck v0.0.0-20181223084120-ef45e06d44b6 | ||
github.com/golangci/go-tools v0.0.0-20180109140146-af6baa5dc196 => github.com/golangci/go-tools v0.0.0-20190318060251-af6baa5dc196 | ||
github.com/golangci/gofmt v0.0.0-20181105071733-0b8337e80d98 => github.com/golangci/gofmt v0.0.0-20181222123516-0b8337e80d98 | ||
github.com/golangci/gosec v0.0.0-20180901114220-66fb7fc33547 => github.com/golangci/gosec v0.0.0-20190211064107-66fb7fc33547 | ||
github.com/golangci/ineffassign v0.0.0-20180808204949-42439a7714cc => github.com/golangci/ineffassign v0.0.0-20190609212857-42439a7714cc | ||
github.com/golangci/lint-1 v0.0.0-20180610141402-ee948d087217 => github.com/golangci/lint-1 v0.0.0-20190420132249-ee948d087217 | ||
mvdan.cc/unparam v0.0.0-20190124213536-fbb59629db34 => mvdan.cc/unparam v0.0.0-20190209190245-fbb59629db34 | ||
) | ||
require github.com/golangci/golangci-lint v1.30.0 |
Oops, something went wrong.