ac-library-rs icon indicating copy to clipboard operation
ac-library-rs copied to clipboard

Suppress some annoying lints in what way

Open qryxip opened this issue 5 years ago • 4 comments

BTW, how do we suppress clippy::many_single_char_names? Adding #![allow] to each module, or the crate root?

#![allow(clippy::many_single_char_names)]

Originally posted by @qryxip in https://github.com/rust-lang-ja/ac-library-rs/pull/3#issuecomment-688622868

qryxip avatar Sep 09 '20 13:09 qryxip

I prefer adding to each module/item or avoid single-character variable names in the first place, but adding to lib.rs is a reasonable approach since many_single_char_names gets easily triggered.

qryxip avatar Sep 09 '20 13:09 qryxip

CC: @TonalidadeHidrica @koba-e964 @kenkoooo

qryxip avatar Sep 09 '20 13:09 qryxip

I think many_single_char_name warning is still useful. I know AtCoder's library is using a lot of single-character variables. To avoid confusing the library users, it's better not to change the behavior and the interface. But we can change the variable names. It will help reviewers read the code and find bugs and help users understand the algorithms.

kenkoooo avatar Sep 09 '20 13:09 kenkoooo

note: Clippy is currently bundled with rustup (if you newly install Rust, you'll also install cargo-clippy), and be intended to used as a static code analysis tool running on editors such as VSCode.

qryxip avatar Sep 09 '20 13:09 qryxip