Skip to content
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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

ffranr
Copy link

@ffranr ffranr commented Feb 29, 2024

I couldn't reproduce the CI lint results (no lint errors) locally.

Copy link
Collaborator

@guggero guggero left a 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
Copy link
Collaborator

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)
Copy link
Collaborator

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] \
Copy link
Collaborator

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) {
Copy link
Collaborator

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants