-
Notifications
You must be signed in to change notification settings - Fork 1
feat: add unused dependency checks to pre-commit hook #153
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
feat: add unused dependency checks to pre-commit hook #153
Conversation
@l-monninger I noticed |
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.
Not sure why, but the cargo test
check I keep getting
error: Cannot build '/nix/store/fdyrnfa2an9l6jqmlj40yh8ln4sx5vaj-celestia-node-0.20.4-go-modules.drv'.
Reason: builder failed with exit code 1.
Output paths:
/nix/store/fp33wa4rk3j4rs2s64bf7n3ni0lk73bj-celestia-node-0.20.4-go-modules
Last 25 log lines:
> go: github.com/celestiaorg/celestia-node/cmd imports
> github.com/celestiaorg/celestia-app/v3/app imports
> github.com/cosmos/ibc-go/v6/testing imports
> github.com/cosmos/ibc-go/v6/testing/simapp imports
> github.com/cosmos/cosmos-sdk/x/upgrade: github.com/celestiaorg/[email protected]: reading https://proxy.golang.org/github.com/celestiaorg/cosmos-sdk/@v/v1.25.0-sdk-v0.46.16.zip: 500 Internal Server Error
> go: github.com/celestiaorg/celestia-node/cmd imports
> github.com/celestiaorg/celestia-app/v3/app imports
> github.com/cosmos/ibc-go/v6/testing imports
> github.com/cosmos/ibc-go/v6/testing/simapp imports
> github.com/cosmos/cosmos-sdk/x/upgrade/client: github.com/celestiaorg/[email protected]: reading https://proxy.golang.org/github.com/celestiaorg/cosmos-sdk/@v/v1.25.0-sdk-v0.46.16.zip: 500 Internal Server Error
> go: github.com/celestiaorg/celestia-node/cmd/cel-shed imports
> github.com/grafana/pyroscope-go imports
> github.com/grafana/pyroscope-go/godeltaprof imports
> github.com/grafana/pyroscope-go/godeltaprof/internal/pprof imports
> github.com/klauspost/compress/gzip: github.com/klauspost/[email protected]: reading https://proxy.golang.org/github.com/klauspost/compress/@v/v1.17.11.zip: 503 Service Unavailable
> go: github.com/celestiaorg/celestia-node/nodebuilder imports
> github.com/ipfs/go-ds-badger4 imports
> github.com/dgraph-io/badger/v4 imports
> github.com/dgraph-io/badger/v4/table imports
> github.com/klauspost/compress/s2: github.com/klauspost/[email protected]: reading https://proxy.golang.org/github.com/klauspost/compress/@v/v1.17.11.zip: 503 Service Unavailable
> go: github.com/celestiaorg/celestia-node/nodebuilder imports
> github.com/ipfs/go-ds-badger4 imports
> github.com/dgraph-io/badger/v4 imports
> github.com/dgraph-io/badger/v4/table imports
> github.com/klauspost/compress/snappy: github.com/klauspost/[email protected]: reading https://proxy.golang.org/github.com/klauspost/compress/@v/v1.17.11.zip: 503 Service Unavailable
For full logs, run:
nix log /nix/store/fdyrnfa2an9l6jqmlj40yh8ln4sx5vaj-celestia-node-0.20.4-go-modules.drv
error: Cannot build '/nix/store/a73n8cylx33l041f0axbrjxs8ir8mr59-celestia-node-0.20.4.drv'.
Reason: 1 dependency failed.
Output paths:
/nix/store/ikkxf61kmpvw2li0f00yvkhyp1m4d2z3-celestia-node-0.20.4
error: Cannot build '/nix/store/l3k7yvi718v6qq7aqsb11jqm8pm4d1js-nix-shell-env.drv'.
Reason: 1 dependency failed.
Output paths:
/nix/store/yzjd1hyzr7b0jv28sxgjpc8djrrjqcdx-nix-shell-env
I've retried it a couple times now.
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.
5599c72
into
l-monninger/environments-api
Yeah, I saw the email @andygolay. Something to be aware of. It might be nice to pair this with a |
Summary
Uses
cargo-machete
to check for unused dependencies in the pre-commit hook. Errors the pre-commit if there are unused or unpatched dependencies.I also naturally removed dependencies which would currently violate this check.
Tip
To double check the erroring on unused dependencies, add some like
future = { workspace = true }
to a crate and try to commit it.Note
I checked this out from #152 because I wanted to clean as many dependencies as possible.