Skip to content
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

Improve too_many_arguments: only highlight function arguments instead of entire function #2488

Closed
alexheretic opened this issue Feb 26, 2018 · 2 comments
Labels
C-enhancement Category: Enhancement of lints, like adding more cases or adding help messages

Comments

@alexheretic
Copy link
Member

Too many arguments lint highlights the entire function which can end up being quite visually noisey. It would be nicer to highlight the arguments / lines with arguments in them or similar.

fn foo(_: u8, _: u8, _: u8, _: u8, _: u8, _: u8, _: u8, _: u8) {
    let _prefectly = "tarred";
    let _fine = "with";
    let _code = "same";
    let _is = "brush";
}
fn main() {
    foo(1, 2, 3, 4, 5, 6, 7, 8);
}

atom ide-rust

warning: this function has too many arguments (8/7)
 --> src/main.rs:1:1
  |
1 | / fn foo(_: u8, _: u8, _: u8, _: u8, _: u8, _: u8, _: u8, _: u8) {
2 | |     let _prefectly = "tarred";
3 | |     let _fine = "with";
4 | |     let _code = "same";
5 | |     let _is = "brush";
6 | | }
  | |_^
  |
  = note: #[warn(too_many_arguments)] on by default
  = help: for further information visit https://rust-lang-nursery.github.io/rust-clippy/v0.0.186/index.html#too_many_arguments
@phansch phansch added the C-enhancement Category: Enhancement of lints, like adding more cases or adding help messages label Mar 30, 2018
@camelid
Copy link
Member

camelid commented Feb 8, 2021

Seems to be fixed now:

warning: this function has too many arguments (8/7)
 --> src/main.rs:1:1
  |
1 | fn foo(_: u8, _: u8, _: u8, _: u8, _: u8, _: u8, _: u8, _: u8) {
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  |
  = note: `#[warn(clippy::too_many_arguments)]` on by default
  = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments

@giraffate
Copy link
Contributor

Thanks! It seems to be fixed by #4053, so I'm closing this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-enhancement Category: Enhancement of lints, like adding more cases or adding help messages
Projects
None yet
Development

No branches or pull requests

4 participants