mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-11-27 07:00:55 +00:00
Adding back tests, but also reducing threshold by 1
This commit is contained in:
parent
e583f35b3a
commit
c1f4e18453
3 changed files with 180 additions and 1 deletions
|
@ -149,7 +149,7 @@ define_Conf! {
|
|||
/// Lint: TRIVIALLY_COPY_PASS_BY_REF. The maximum size (in bytes) to consider a `Copy` type for passing by value instead of by reference.
|
||||
(trivial_copy_size_limit, "trivial_copy_size_limit", None => Option<u64>),
|
||||
/// Lint: TOO_MANY_LINES. The maximum number of lines a function or method can have
|
||||
(too_many_lines_threshold, "too_many_lines_threshold", 101 => u64),
|
||||
(too_many_lines_threshold, "too_many_lines_threshold", 100 => u64),
|
||||
}
|
||||
|
||||
impl Default for Conf {
|
||||
|
|
163
tests/ui/functions_maxlines.rs
Normal file
163
tests/ui/functions_maxlines.rs
Normal file
|
@ -0,0 +1,163 @@
|
|||
#![warn(clippy::all, clippy::pedantic)]
|
||||
|
||||
// TOO_MANY_LINES
|
||||
fn good_lines() {
|
||||
/* println!("This is good."); */
|
||||
// println!("This is good.");
|
||||
/* */ // println!("This is good.");
|
||||
/* */ // println!("This is good.");
|
||||
/* */ // println!("This is good.");
|
||||
/* */ // println!("This is good.");
|
||||
/* println!("This is good.");
|
||||
println!("This is good.");
|
||||
println!("This is good.");
|
||||
println!("This is good.");
|
||||
println!("This is good.");
|
||||
println!("This is good.");
|
||||
println!("This is good.");
|
||||
println!("This is good.");
|
||||
println!("This is good.");
|
||||
println!("This is good.");
|
||||
println!("This is good.");
|
||||
println!("This is good.");
|
||||
println!("This is good.");
|
||||
println!("This is good.");
|
||||
println!("This is good.");
|
||||
println!("This is good.");
|
||||
println!("This is good.");
|
||||
println!("This is good.");
|
||||
println!("This is good.");
|
||||
println!("This is good."); */
|
||||
println!("This is good.");
|
||||
println!("This is good.");
|
||||
println!("This is good.");
|
||||
println!("This is good.");
|
||||
println!("This is good.");
|
||||
println!("This is good.");
|
||||
println!("This is good.");
|
||||
println!("This is good.");
|
||||
println!("This is good.");
|
||||
println!("This is good.");
|
||||
println!("This is good.");
|
||||
println!("This is good.");
|
||||
println!("This is good.");
|
||||
println!("This is good.");
|
||||
println!("This is good.");
|
||||
println!("This is good.");
|
||||
println!("This is good.");
|
||||
println!("This is good.");
|
||||
println!("This is good.");
|
||||
println!("This is good.");
|
||||
println!("This is good.");
|
||||
println!("This is good.");
|
||||
println!("This is good.");
|
||||
println!("This is good.");
|
||||
println!("This is good.");
|
||||
println!("This is good.");
|
||||
}
|
||||
|
||||
fn bad_lines() {
|
||||
println!("This is bad.");
|
||||
println!("This is bad.");
|
||||
println!("This is bad.");
|
||||
println!("This is bad.");
|
||||
println!("This is bad.");
|
||||
println!("This is bad.");
|
||||
println!("This is bad.");
|
||||
println!("This is bad.");
|
||||
println!("This is bad.");
|
||||
println!("This is bad.");
|
||||
println!("This is bad.");
|
||||
println!("This is bad.");
|
||||
println!("This is bad.");
|
||||
println!("This is bad.");
|
||||
println!("This is bad.");
|
||||
println!("This is bad.");
|
||||
println!("This is bad.");
|
||||
println!("This is bad.");
|
||||
println!("This is bad.");
|
||||
println!("This is bad.");
|
||||
println!("This is bad.");
|
||||
println!("This is bad.");
|
||||
println!("This is bad.");
|
||||
println!("This is bad.");
|
||||
println!("This is bad.");
|
||||
println!("This is bad.");
|
||||
println!("This is bad.");
|
||||
println!("This is bad.");
|
||||
println!("This is bad.");
|
||||
println!("This is bad.");
|
||||
println!("This is bad.");
|
||||
println!("This is bad.");
|
||||
println!("This is bad.");
|
||||
println!("This is bad.");
|
||||
println!("This is bad.");
|
||||
println!("This is bad.");
|
||||
println!("This is bad.");
|
||||
println!("This is bad.");
|
||||
println!("This is bad.");
|
||||
println!("This is bad.");
|
||||
println!("This is bad.");
|
||||
println!("This is bad.");
|
||||
println!("This is bad.");
|
||||
println!("This is bad.");
|
||||
println!("This is bad.");
|
||||
println!("This is bad.");
|
||||
println!("This is bad.");
|
||||
println!("This is bad.");
|
||||
println!("This is bad.");
|
||||
println!("This is bad.");
|
||||
println!("This is bad.");
|
||||
println!("This is bad.");
|
||||
println!("This is bad.");
|
||||
println!("This is bad.");
|
||||
println!("This is bad.");
|
||||
println!("This is bad.");
|
||||
println!("This is bad.");
|
||||
println!("This is bad.");
|
||||
println!("This is bad.");
|
||||
println!("This is bad.");
|
||||
println!("This is bad.");
|
||||
println!("This is bad.");
|
||||
println!("This is bad.");
|
||||
println!("This is bad.");
|
||||
println!("This is bad.");
|
||||
println!("This is bad.");
|
||||
println!("This is bad.");
|
||||
println!("This is bad.");
|
||||
println!("This is bad.");
|
||||
println!("This is bad.");
|
||||
println!("This is bad.");
|
||||
println!("This is bad.");
|
||||
println!("This is bad.");
|
||||
println!("This is bad.");
|
||||
println!("This is bad.");
|
||||
println!("This is bad.");
|
||||
println!("This is bad.");
|
||||
println!("This is bad.");
|
||||
println!("This is bad.");
|
||||
println!("This is bad.");
|
||||
println!("This is bad.");
|
||||
println!("This is bad.");
|
||||
println!("This is bad.");
|
||||
println!("This is bad.");
|
||||
println!("This is bad.");
|
||||
println!("This is bad.");
|
||||
println!("This is bad.");
|
||||
println!("This is bad.");
|
||||
println!("This is bad.");
|
||||
println!("This is bad.");
|
||||
println!("This is bad.");
|
||||
println!("This is bad.");
|
||||
println!("This is bad.");
|
||||
println!("This is bad.");
|
||||
println!("This is bad.");
|
||||
println!("This is bad.");
|
||||
println!("This is bad.");
|
||||
println!("This is bad.");
|
||||
println!("This is bad.");
|
||||
println!("This is bad.");
|
||||
println!("This is bad.");
|
||||
}
|
||||
|
||||
fn main() {}
|
16
tests/ui/functions_maxlines.stderr
Normal file
16
tests/ui/functions_maxlines.stderr
Normal file
|
@ -0,0 +1,16 @@
|
|||
error: This function has a large number of lines.
|
||||
--> $DIR/functions_maxlines.rs:59:1
|
||||
|
|
||||
LL | / fn bad_lines() {
|
||||
LL | | println!("This is bad.");
|
||||
LL | | println!("This is bad.");
|
||||
LL | | println!("This is bad.");
|
||||
... |
|
||||
LL | | println!("This is bad.");
|
||||
LL | | }
|
||||
| |_^
|
||||
|
|
||||
= note: `-D clippy::too-many-lines` implied by `-D warnings`
|
||||
|
||||
error: aborting due to previous error
|
||||
|
Loading…
Reference in a new issue