-
Notifications
You must be signed in to change notification settings - Fork 586
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
WIP: testing docker linter #911
base: master
Are you sure you want to change the base?
Conversation
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.
Nice! Compilation seems to fail, but this will be very useful, thanks for adding!
&& cd /tmp/tools \ | ||
&& go install -trimpath github.com/golangci/golangci-lint/cmd/[email protected] \ | ||
&& chmod -R 777 /tmp/build/ \ | ||
&& git config --global --add safe.directory /build |
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.
We added this line when we didn't know what the actual issue was and it's more of an ugly hack. The "better" solution would be this environment variable: https://github.com/lightninglabs/pool/blob/master/tools/Dockerfile#L6
So just ENV GOFLAGS="-buildvcs=false"
.
We should probably update this in other projects too to make things more consistent (and to avoid us copying the "hacky" version to new projects).
|
||
GOPATH := $(shell go env GOPATH) |
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.
nit: LINT_COMMIT
below is now unused.
It would also be nice if we could remove the GOACC_COMMIT
and GOIMPORTS_COMMIT
values as well by creating a go.mod
file in the tools
directory that pins these versions, then just install them from the tools
directory as we do here: https://github.com/lightninglabs/taproot-assets/blob/main/Makefile#L79
&& mkdir -p /tmp/build/.cache \ | ||
&& mkdir -p /tmp/build/.modcache \ | ||
&& cd /tmp/tools \ | ||
&& go install -trimpath github.com/golangci/golangci-lint/cmd/[email protected] \ |
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.
Same comment here, re pinning the version in a go.mod
file instead.
@@ -42,6 +42,10 @@ func (m *mockChainClient) GetBlockHeader(*chainhash.Hash) (*wire.BlockHeader, | |||
return nil, nil | |||
} | |||
|
|||
func (m *mockChainClient) GetBlockHeight(*chainhash.Hash) (int32, error) { |
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 same method needs to be added to the RPCClient
.
I couldn't reproduce the CI lint results (no lint errors) locally.