Closed cvybhu closed 8 months ago
New version of clippy introduced the uninlined_format_args lint which recommends putting variable names directly into format strings.
In #639 we decided that the new lint should be disabled for now, because rust-analyzer has limited support for the code that clippy proposes. The lint was disabled in CI and Makefile by adding a flag, but manually running
cargo clippy
would still throw a ton of errors. Having to always add this flag is an unneeded annoyance for developers.
You can set up the RUSTFLAGS environment variable and not have to worry about it:
export RUSTFLAGS="-Aclippy::uninlined_format_args"
Maybe we could disable the lint on the level of the whole crate? I think there's a special syntax for macros that are supposed to cover the whole crate, something like
#![allow(clippy::new_ret_no_self)]
(saw it here).
I originally didn't decide to do it like this because we actually have multiple crates: scylla, scylla-cql, scylla-proxy, every integration test and example - they all count as separate crates and need a separate allow
attribute. It's not super hard work, but it sounds annoying to do something like this just to disable a single lint, and you need to remember to disable it in new examples/integration tests. Usually we avoid such problems by just fixing the new issues pointed out by clippy, but this time I think we should wait until support for renaming in rust-analyzer gets better.
That said, I'm not strongly opposed to introducing the annotations if it's just for this single lint. If you feel it will make life easier to developers, then please send a PR.
I wish there were a better way to handle this, but AFAIK there is no such way at the moment. In the future it will be possible to disable lints in Cargo.toml
: https://github.com/rust-lang/cargo/issues/5034
Note: version 1.67.1 has been released: https://blog.rust-lang.org/2023/02/09/Rust-1.67.1.html . One of the few changes was to disable the lint. It will take some time until it is available on GitHub's ubuntu-latest
, though.
Note: version 1.67.1 has been released: https://blog.rust-lang.org/2023/02/09/Rust-1.67.1.html . One of the few changes was to disable the lint. It will take some time until it is available on GitHub's ubuntu-latest, though.
What's the status of this?
I believe the issue is not resolved yet because of this:
I also created this issue to track the problem and remeber to make the code clippy compliant once rust-analyzer is able to handle everything.
AFAIK rust-analyzer doesn't support renaming in format strings yet.
New version of clippy introduced the uninlined_format_args lint which recommends putting variable names directly into format strings.
In #639 we decided that the new lint should be disabled for now, because rust-analyzer has limited support for the code that clippy proposes. The lint was disabled in CI and Makefile by adding a flag, but manually running
cargo clippy
would still throw a ton of errors. Having to always add this flag is an unneeded annoyance for developers.Maybe we could disable the lint on the level of the whole crate? I think there's a special syntax for macros that are supposed to cover the whole crate, something like
#![allow(clippy::new_ret_no_self)]
(saw it here).I also created this issue to track the problem and remeber to make the code clippy compliant once rust-analyzer is able to handle everything.