Skip to content

Commit

Permalink
Bump up golangci-lint to v1.52.2
Browse files Browse the repository at this point in the history
Signed-off-by: Kohei Tokunaga <[email protected]>
  • Loading branch information
ktock committed Apr 20, 2023
1 parent 333ee91 commit b96586f
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 1 deletion.
53 changes: 53 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,59 @@ linters-settings:
- G504 # Import blocklist: net/http/cgi
config:
G306: "0644"
revive:
# Selectively disable rules too strict for us.
# Rules are based on https://github.com/mgechev/revive/tree/v1.3.1#recommended-configuration but we disabled if-return and unused-parameter
# It seems that we can't exclude specific rules so we define the entier rule table here.
rules:
- name: blank-imports
disabled: false
- name: context-as-argument
disabled: false
- name: context-keys-type
disabled: false
- name: dot-imports
disabled: false
- name: error-return
disabled: false
- name: error-strings
disabled: false
- name: error-naming
disabled: false
- name: exported
disabled: false
# - name: if-return
# disabled: false
- name: increment-decrement
disabled: false
- name: var-naming
disabled: false
- name: var-declaration
disabled: false
- name: package-comments
disabled: false
- name: range
disabled: false
- name: receiver-naming
disabled: false
- name: time-naming
disabled: false
- name: unexported-return
disabled: false
- name: indent-error-flow
disabled: false
- name: errorf
disabled: false
# - name: empty-block
# disabled: false
# - name: superfluous-else
# disabled: false
# - name: unused-parameter
# disabled: false
# - name: unreachable-code
# disabled: false
# - name: redefines-builtin-id
# disabled: false

issues:
exclude-rules:
Expand Down
2 changes: 1 addition & 1 deletion hack/dockerfiles/lint.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ ARG GO_VERSION=1.20
FROM golang:${GO_VERSION}-alpine
ENV GOFLAGS="-buildvcs=false"
RUN apk add --no-cache gcc musl-dev yamllint
RUN wget -O- -nv https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s v1.51.1
RUN wget -O- -nv https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s v1.52.2
WORKDIR /go/src/github.com/moby/buildkit
RUN --mount=target=/go/src/github.com/moby/buildkit --mount=target=/root/.cache,type=cache \
GOARCH=amd64 golangci-lint run && \
Expand Down

0 comments on commit b96586f

Please sign in to comment.