ros2_rust
ros2_rust copied to clipboard
Crate imports_granularity requires nightly
This was identified by @luca-della-vedova here.
Currently, our CI doesn't actually check that our imports are formatted with crate level import granularity. Additionally, this functionality is an unstable feature (https://github.com/rust-lang/rustfmt/issues/4991) so it's only supported in nightly.
Running locally without a nightly toolchain
ros2_rust/rclrs$ cargo fmt
Warning: can't set `imports_granularity = Crate`, unstable features are only available in nightly channel.
The way I see it, we have two options.
- We manually check imports and try to catch this in PRs
- We start using a nightly toolchain in our CI. We can mitigate some of the churn for nightly here by selecting a version ourselves.
Isn't this something that should be mentioned directly in the readmy or .rustfmt.toml as a comment? The Cargo manifest format allows comments starting with #.
@maspe36 I prefer to only target stable for builds, however we could target nightly for formatting, but I wonder how much of a moving target it is.
#396 should get us what we want. It will continue to build and test the repo using the stable channel but use nightly when checking the format.
Ah yeah, I didn't word the second option well but #396 is exactly what I was referring to. We can close once that's merged.