Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
1f82d834
Commit
1f82d834
authored
Mar 24, 2019
by
Erik Wilson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Upgrade to golangci-lint
parent
44634088
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
34 additions
and
39 deletions
+34
-39
.golangci.json
.golangci.json
+19
-0
.gometalinter.json
.gometalinter.json
+0
-12
Dockerfile.dapper
Dockerfile.dapper
+8
-7
validate
scripts/validate
+7
-20
No files found.
.golangci.json
0 → 100644
View file @
1f82d834
{
"linters"
:
{
"disable-all"
:
true
,
"enable"
:
[
"govet"
,
"golint"
,
"goimports"
,
"misspell"
,
"ineffassign"
,
"gofmt"
]
},
"run"
:
{
"skip-files"
:
[
"/zz_generated_"
],
"deadline"
:
"5m"
}
}
.gometalinter.json
deleted
100644 → 0
View file @
44634088
{
"EnableAll"
:
false
,
"Enable"
:
[
"golint"
,
"goimports"
,
"misspell"
,
"ineffassign"
,
"errcheck"
],
"Deadline"
:
"1m"
}
\ No newline at end of file
Dockerfile.dapper
View file @
1f82d834
...
@@ -6,17 +6,18 @@ RUN apk -U --no-cache add bash git gcc musl-dev docker vim less file curl wget c
...
@@ -6,17 +6,18 @@ RUN apk -U --no-cache add bash git gcc musl-dev docker vim less file curl wget c
RUN pip3 install 'tox==3.6.0'
RUN pip3 install 'tox==3.6.0'
RUN apk -U --no-cache --repository http://dl-3.alpinelinux.org/alpine/edge/main/ add sqlite-dev sqlite-static
RUN apk -U --no-cache --repository http://dl-3.alpinelinux.org/alpine/edge/main/ add sqlite-dev sqlite-static
RUN mkdir -p /go/src/golang.org/x && \
RUN mkdir -p /go/src/golang.org/x && \
cd /go/src/golang.org/x && git clone https://github.com/golang/tools && git clone https://github.com/golang/lint && \
cd /go/src/golang.org/x && git clone https://github.com/golang/tools && \
git -C /go/src/golang.org/x/lint/golint checkout -b current 06c8688daad7faa9da5a0c2f163a3d14aac986ca && \
git -C /go/src/golang.org/x/tools checkout -b current e9f45831faab4562ce3f53f7196b67c08f948e86 && \
go install golang.org/x/lint/golint
go install golang.org/x/tools/cmd/goimports
RUN go get -d github.com/alecthomas/gometalinter && \
git -C /go/src/github.com/alecthomas/gometalinter checkout -b current v2.0.11 && \
go install github.com/alecthomas/gometalinter && \
gometalinter --install
RUN rm -rf /go/src /go/pkg
RUN rm -rf /go/src /go/pkg
ARG DAPPER_HOST_ARCH
ARG DAPPER_HOST_ARCH
ENV ARCH $DAPPER_HOST_ARCH
ENV ARCH $DAPPER_HOST_ARCH
RUN if [ "${ARCH}" == "amd64" ]; then \
curl -sL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh -s v1.15.0; \
fi
ENV DAPPER_RUN_ARGS --privileged -v k3s-cache:/go/src/github.com/rancher/k3s/.cache
ENV DAPPER_RUN_ARGS --privileged -v k3s-cache:/go/src/github.com/rancher/k3s/.cache
ENV DAPPER_ENV REPO TAG DRONE_TAG IMAGE_NAME
ENV DAPPER_ENV REPO TAG DRONE_TAG IMAGE_NAME
ENV DAPPER_SOURCE /go/src/github.com/rancher/k3s/
ENV DAPPER_SOURCE /go/src/github.com/rancher/k3s/
...
...
scripts/validate
View file @
1f82d834
...
@@ -3,34 +3,21 @@ set -e
...
@@ -3,34 +3,21 @@ set -e
cd
$(
dirname
$0
)
/..
cd
$(
dirname
$0
)
/..
if
!
command
-v
golangci-lint
;
then
echo
Skipping validation: no golangci-lint available
exit
fi
echo
Running validation
echo
Running validation
PACKAGES
=
"
$(
go list ./...
)
"
if
[
!
-e
build/data
]
;
then
if
[
!
-e
build/data
]
;
then
mkdir
-p
build/data
mkdir
-p
build/data
fi
fi
echo
Running: go generate
go generate
go generate
echo
Running: go vet
echo
Running: golangci-lint
go vet
${
PACKAGES
}
golangci-lint run
echo
Running: gometalinter
for
i
in
${
PACKAGES
}
;
do
if
[
-n
"
$(
gometalinter
$i
|
\
grep
-v
'pkg/data/zz_generated_bindata.go'
|
\
grep
-v
'should have comment.*or be unexported'
|
\
grep
-v
'cli/cmd.*don.t use underscores in Go name'
|
\
grep
-v
'cli/cmd.*should be DNS'
|
\
tee
/dev/stderr
)
"
]
;
then
failed
=
true
fi
done
test
-z
"
$failed
"
echo
Running: go
fmt
test
-z
"
$(
go
fmt
${
PACKAGES
}
|
\
grep
-v
'pkg/data/zz_generated_bindata.go'
|
\
tee
/dev/stderr
)
"
.
./scripts/version.sh
.
./scripts/version.sh
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment