File tree Expand file tree Collapse file tree 4 files changed +34
-38
lines changed
Expand file tree Collapse file tree 4 files changed +34
-38
lines changed Original file line number Diff line number Diff line change 1+ {
2+ "linters" : {
3+ "disable-all" : true ,
4+ "enable" : [
5+ " govet" ,
6+ " golint" ,
7+ " goimports" ,
8+ " misspell" ,
9+ " ineffassign" ,
10+ " gofmt"
11+ ]
12+ },
13+ "run" : {
14+ "skip-files" : [
15+ " /zz_generated_"
16+ ],
17+ "deadline" : " 5m"
18+ }
19+ }
Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -6,17 +6,18 @@ RUN apk -U --no-cache add bash git gcc musl-dev docker vim less file curl wget c
66RUN pip3 install 'tox==3.6.0'
77RUN apk -U --no-cache --repository http://dl-3.alpinelinux.org/alpine/edge/main/ add sqlite-dev sqlite-static
88RUN mkdir -p /go/src/golang.org/x && \
9- cd /go/src/golang.org/x && git clone https://github.com/golang/tools && git clone https://github.com/golang/lint && \
10- git -C /go/src/golang.org/x/lint/golint checkout -b current 06c8688daad7faa9da5a0c2f163a3d14aac986ca && \
11- go install golang.org/x/lint/golint
12- RUN go get -d github.com/alecthomas/gometalinter && \
13- git -C /go/src/github.com/alecthomas/gometalinter checkout -b current v2.0.11 && \
14- go install github.com/alecthomas/gometalinter && \
15- gometalinter --install
9+ cd /go/src/golang.org/x && git clone https://github.com/golang/tools && \
10+ git -C /go/src/golang.org/x/tools checkout -b current e9f45831faab4562ce3f53f7196b67c08f948e86 && \
11+ go install golang.org/x/tools/cmd/goimports
1612RUN rm -rf /go/src /go/pkg
1713
1814ARG DAPPER_HOST_ARCH
1915ENV ARCH $DAPPER_HOST_ARCH
16+
17+ RUN if [ "${ARCH}" == "amd64" ]; then \
18+ curl -sL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh -s v1.15.0; \
19+ fi
20+
2021ENV DAPPER_RUN_ARGS --privileged -v k3s-cache:/go/src/github.com/rancher/k3s/.cache
2122ENV DAPPER_ENV REPO TAG DRONE_TAG IMAGE_NAME
2223ENV DAPPER_SOURCE /go/src/github.com/rancher/k3s/
Original file line number Diff line number Diff line change 33
44cd $( dirname $0 ) /..
55
6+ if ! command -v golangci-lint; then
7+ echo Skipping validation: no golangci-lint available
8+ exit
9+ fi
610echo Running validation
711
8- PACKAGES=" $( go list ./...) "
9-
1012if [ ! -e build/data ]; then
1113 mkdir -p build/data
1214fi
1315
16+ echo Running: go generate
1417go generate
1518
16- echo Running: go vet
17- go vet ${PACKAGES}
18- echo Running: gometalinter
19- for i in ${PACKAGES} ; do
20- if [ -n " $( gometalinter $i | \
21- grep -v ' pkg/data/zz_generated_bindata.go' | \
22- grep -v ' should have comment.*or be unexported' | \
23- grep -v ' cli/cmd.*don.t use underscores in Go name' | \
24- grep -v ' cli/cmd.*should be DNS' | \
25- tee /dev/stderr) " ]; then
26- failed=true
27- fi
28- done
29- test -z " $failed "
30- echo Running: go fmt
31- test -z " $( go fmt ${PACKAGES} | \
32- grep -v ' pkg/data/zz_generated_bindata.go' | \
33- tee /dev/stderr) "
19+ echo Running: golangci-lint
20+ golangci-lint run
3421
3522. ./scripts/version.sh
3623
You can’t perform that action at this time.
0 commit comments