Consider publishing `clippy_utils` as a crates.io crate for others to reuse
Description
Over at the bevy_cli project, we're implementing custom lints for Bevy, and bootstrapping off of Clippy's existing tools :) We'd love to publish this to crates.io so folks can cargo install bevy_cli, but can't do so easily due to clippy_utils only existing as a git dependency.
We don't particularly care about stability or the like: simply publishing whatever you have periodically would be enough.
Prompted by https://github.com/TheBevyFlock/bevy_cli/issues/150
For the period, you could definitely match what Cargo does and publish for every stable release (as long as each release provides what nightly version they were pinned to at that time).
Publishing clippy_utils will also require clippy_config, but that's also reserved on https://crates.io.
Thanks for your consideration!
as long as each release provides what nightly version they were pinned to at that time
How would you recommend to best provide this information?
Publishing
clippy_utilswill also requireclippy_config, but that's also reserved on https://crates.io.
Yeah, I made sure that those crates are squatted for us (with me and rust-lang-owner as owners) recently, in anticipation that such a request would come up at some point. I just thought it would be from the dylint maintainers. cc @smoelius
as long as each release provides what nightly version they were pinned to at that time
How would you recommend to best provide this information?
The channel field within rust-toolchain is enough! :)
If releases are to be automated, you can automatically extract this value using Taplo. I did something very similar in bevy_lint's CI.
Offtopic: shouldn't this be
toolchain: ${{ needs.extract-rust-version.outputs.toolchain }}
in your workflow file?
Extracting this in an automated way from the rust-toolchain file is easy. I'd probably just use a grep command though. My question is more: where should I put this information? Just in the README of clippy_utils/clippy_config?
Offtopic: shouldn't this be
toolchain: ${{ needs.extract-rust-version.outputs.toolchain }}in your workflow file?
For a second I thought so too, but I rename it in the job outputs:
outputs:
channel: ${{ steps.toolchain.outputs.toolchain }}
components: ${{ steps.toolchain.outputs.components }}
This is confusing, though, so I'll probably change it.
Extracting this in an automated way from the
rust-toolchainfile is easy. I'd probably just use agrepcommand though. My question is more: where should I put this information? Just in theREADMEofclippy_utils/clippy_config?
If you use Github Releases, you could add it there. (Maybe also the CHANGELOG.md?)
CHANGELOG.md is just for stable and external releases for Clippy itself. Not for something like this. And I'd like to keep it that way.
If we would start using Github releases, I think we would need to copy the whole changelog there every time, so that it is a proper release. I'd rather avoid that.
So I guess, I will add it to the README of the crates, so that it also shows up on the crates.io page when publishing.
So I guess, I will add it to the
READMEof the crates, so that it also shows up on the crates.io page when publishing.
If that's too much of a hassle, each release is tagged, so I can figure it out using the tagged commit.
Let's wait for the clippy meeting where we talk about this. And if we decide that we want to publish it, I'll think about what would work for me and other people involved in releases and would make it easy for you to find the toolchain.
We'd love to publish this to crates.io so folks can
cargo install bevy_cli, but can't do so easily due toclippy_utilsonly existing as a git dependency.
Won't the user have to specify the toolchain on the command line, e.g.:
cargo +nightly-2024-10-03 install bevy_cli
Or am I missing something?
Won't the user have to specify the toolchain on the command line, e.g.:
cargo +nightly-2024-10-03 install bevy_cliOr am I missing something?
You're right, but I still prefer it to --git https://github.com/ TheBevyFlock/bevy_cli --tag lint-v0.1.0 bevy_lint! It's shorter and I trust it more, since unlike tags versions published to crates.io cannot be modified.
https://crates.io/crates/clippy_utils
#13700 will close this issue.
Thank you so much! :D