-
Notifications
You must be signed in to change notification settings - Fork 817
Move to golangci-lint #1853
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Move to golangci-lint #1853
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
8e4a0fc
Move to golangci-lint
bboreham 78be66f
Remove some unnecessary steps from the build image
bboreham f693322
Run lint again because it fails the first time
bboreham daf2596
Bit more DRY in Makefile
bboreham ed3ad4c
Add :delegated to speed compilation on Mac
bboreham cfaa978
Add linter configuration to skip some checks
bboreham 9d7a794
Fix some lint warnings in tests
bboreham 6a79b84
Several code cleanups prompted by golangci-lint
bboreham ae47f74
Stop running 'go test -i' - Go caches builds itself now
bboreham 62d1042
Use build image from this branch
bboreham File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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,3 @@ | ||
io/ioutil.WriteFile | ||
io/ioutil.ReadFile | ||
(github.com/go-kit/kit/log.Logger).Log |
This file contains hidden or 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,8 @@ | ||
output: | ||
format: line-number | ||
|
||
linters-settings: | ||
errcheck: | ||
# path to a file containing a list of functions to exclude from checking | ||
# see https://github.com/kisielk/errcheck#excluding-functions for details | ||
exclude: ./.errcheck-exclude |
This file contains hidden or 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 hidden or 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 |
---|---|---|
|
@@ -4,9 +4,6 @@ RUN apt-get update && apt-get install -y curl python-requests python-yaml file j | |
RUN curl -sL https://deb.nodesource.com/setup_6.x | sh - | ||
RUN apt-get install -y nodejs npm && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* | ||
RUN npm install -g postcss-cli autoprefixer | ||
RUN go clean -i net && \ | ||
go install -tags netgo std && \ | ||
go install -race -tags netgo std | ||
ENV HUGO_VERSION=v0.59.1 | ||
RUN git clone https://github.com/gohugoio/hugo.git --branch ${HUGO_VERSION} --depth 1 && \ | ||
cd hugo && go install --tags extended && cd ../ && \ | ||
|
@@ -15,17 +12,13 @@ RUN curl -fsSLo shfmt https://github.com/mvdan/sh/releases/download/v1.3.0/shfmt | |
echo "b1925c2c405458811f0c227266402cf1868b4de529f114722c2e3a5af4ac7bb2 shfmt" | sha256sum -c && \ | ||
chmod +x shfmt && \ | ||
mv shfmt /usr/bin | ||
RUN curl -sfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh| sh -s -- -b /usr/bin v1.21.0 | ||
RUN GO111MODULE=on go get -tags netgo \ | ||
github.com/fzipp/gocyclo \ | ||
golang.org/x/lint/golint \ | ||
github.com/kisielk/[email protected] \ | ||
github.com/client9/misspell/cmd/[email protected] \ | ||
github.com/golang/protobuf/[email protected] \ | ||
github.com/gogo/protobuf/[email protected] \ | ||
github.com/gogo/protobuf/[email protected] && \ | ||
rm -rf /go/pkg /go/src | ||
RUN curl -Ls https://github.com/golang/dep/releases/download/v0.5.0/dep-linux-amd64 -o $GOPATH/bin/dep && \ | ||
chmod +x $GOPATH/bin/dep | ||
|
||
ENV NODE_PATH=/usr/lib/node_modules | ||
COPY build.sh / | ||
|
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is particularly slow when running on OSX (with Docker for Mac) due to the shared volumes performances. Do you see any problem adding
:delegated
to the 3 related volumes, switchingto
In my case, the execution time difference is:
8m8.369s
1m38.258s
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What does
:delegated
do?Would we want it on all similar lines?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The
:delegated
tells Docker for Mac that the container’s view is authoritative (permit delays before updates on the container appear in the host). Details here: https://docs.docker.com/docker-for-mac/osxfs-caching/I don't have a Linux box right now to play with, but it should just be ignored on Linux.
I would say yes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Have you considered adding
:delegated
to volume mounts?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Have done this now.