forked from docker/cli
-
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.
Remove now obsolete gometalinter and use golangci-lint instead
Signed-off-by: Silvin Lubecki <[email protected]> Signed-off-by: Sebastiaan van Stijn <[email protected]>
- Loading branch information
1 parent
1e77742
commit b7e06f2
Showing
3 changed files
with
100 additions
and
60 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
linters: | ||
enable: | ||
- bodyclose | ||
- deadcode | ||
- dogsled | ||
- gocyclo | ||
- goimports | ||
- golint | ||
- gosec | ||
- gosimple | ||
- govet | ||
- ineffassign | ||
- interfacer | ||
- lll | ||
- megacheck | ||
- misspell | ||
- nakedret | ||
- staticcheck | ||
- structcheck | ||
- typecheck | ||
- unconvert | ||
- unparam | ||
- unused | ||
- varcheck | ||
|
||
disable: | ||
- errcheck | ||
|
||
run: | ||
timeout: 5m | ||
skip-dirs: | ||
- cli/command/stack/kubernetes/api/openapi | ||
- cli/command/stack/kubernetes/api/client | ||
skip-files: | ||
- cli/compose/schema/bindata.go | ||
- .*generated.* | ||
|
||
linters-settings: | ||
gocyclo: | ||
min-complexity: 16 | ||
govet: | ||
check-shadowing: false | ||
lll: | ||
line-length: 200 | ||
nakedret: | ||
command: nakedret | ||
pattern: ^(?P<path>.*?\\.go):(?P<line>\\d+)\\s*(?P<message>.*)$ | ||
|
||
issues: | ||
# The default exclusion rules are a bit too permissive, so copying the relevant ones below | ||
exclude-use-default: false | ||
|
||
exclude: | ||
- parameter .* always receives | ||
|
||
exclude-rules: | ||
# These are copied from the default exclude rules, except for "ineffective break statement" | ||
# and GoDoc checks. | ||
# https://github.com/golangci/golangci-lint/blob/0cc87df732aaf1d5ad9ce9ca538d38d916918b36/pkg/config/config.go#L36 | ||
- text: "Error return value of .((os\\.)?std(out|err)\\..*|.*Close|.*Flush|os\\.Remove(All)?|.*printf?|os\\.(Un)?Setenv). is not checked" | ||
linters: | ||
- errcheck | ||
- text: "func name will be used as test\\.Test.* by other packages, and that stutters; consider calling this" | ||
linters: | ||
- golint | ||
- text: "G103: Use of unsafe calls should be audited" | ||
linters: | ||
- gosec | ||
- text: "G104: Errors unhandled" | ||
linters: | ||
- gosec | ||
- text: "G204: Subprocess launch(ed with (variable|function call)|ing should be audited)" | ||
linters: | ||
- gosec | ||
- text: "(G301|G302): (Expect directory permissions to be 0750 or less|Expect file permissions to be 0600 or less)" | ||
linters: | ||
- gosec | ||
- text: "G304: Potential file inclusion via variable" | ||
linters: | ||
- gosec | ||
- text: "(G201|G202): SQL string (formatting|concatenation)" | ||
linters: | ||
- gosec |
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,20 +1,23 @@ | ||
ARG GO_VERSION=1.12.12 | ||
|
||
FROM golang:${GO_VERSION}-alpine | ||
# syntax=docker/dockerfile:1.1.3-experimental | ||
|
||
RUN apk add -U git | ||
ARG GO_VERSION=1.12.12 | ||
ARG GOLANGCI_LINTER_SHA="v1.21.0" | ||
|
||
ARG GOMETALINTER_SHA=v2.0.6 | ||
RUN go get -d github.com/alecthomas/gometalinter && \ | ||
cd /go/src/github.com/alecthomas/gometalinter && \ | ||
git checkout -q "$GOMETALINTER_SHA" && \ | ||
go build -v -o /usr/local/bin/gometalinter . && \ | ||
gometalinter --install && \ | ||
rm -rf /go/src/* /go/pkg/* | ||
FROM golang:${GO_VERSION}-alpine AS build | ||
ENV CGO_ENABLED=0 | ||
RUN apk add --no-cache git | ||
ARG GOLANGCI_LINTER_SHA | ||
ARG GO111MODULE=on | ||
RUN --mount=type=cache,target=/root/.cache/go-build \ | ||
--mount=type=cache,target=/go/pkg/mod \ | ||
go get github.com/golangci/golangci-lint/cmd/golangci-lint@${GOLANGCI_LINTER_SHA} | ||
|
||
WORKDIR /go/src/github.com/docker/cli | ||
FROM golang:${GO_VERSION}-alpine AS lint | ||
ENV CGO_ENABLED=0 | ||
ENV DISABLE_WARN_OUTSIDE_CONTAINER=1 | ||
ENTRYPOINT ["/usr/local/bin/gometalinter"] | ||
CMD ["--config=gometalinter.json", "./..."] | ||
COPY --from=build /go/bin/golangci-lint /usr/local/bin | ||
WORKDIR /go/src/github.com/docker/cli | ||
ENV GOGC=75 | ||
ENTRYPOINT ["/usr/local/bin/golangci-lint"] | ||
CMD ["run", "--config=.golangci.yml"] | ||
COPY . . |
This file was deleted.
Oops, something went wrong.