File tree Expand file tree Collapse file tree 2 files changed +4
-3
lines changed
tests/ui-toml/functions_maxlines Expand file tree Collapse file tree 2 files changed +4
-3
lines changed Original file line number Diff line number Diff line change 1
1
#![ warn( clippy:: too_many_lines) ]
2
2
3
-
4
3
// This function should be considered one line.
5
4
fn many_comments_but_one_line_of_code ( ) {
6
5
/* println!("This is good."); */
@@ -22,6 +21,7 @@ fn too_many_lines() {
22
21
}
23
22
24
23
// This should be considered one line.
24
+ #[ rustfmt:: skip]
25
25
fn comment_starts_after_code ( ) {
26
26
let _ = 5 ; /* closing comment. */ /*
27
27
this line shouldn't be counted theoretically.
@@ -34,6 +34,7 @@ fn comment_after_code() {
34
34
}
35
35
36
36
// This should fail since it is technically two lines.
37
+ #[ rustfmt:: skip]
37
38
fn comment_before_code ( ) {
38
39
let _ = "test" ;
39
40
/* This comment extends to the front of
Original file line number Diff line number Diff line change 1
1
error: This function has a large number of lines.
2
- --> $DIR/test.rs:19 :1
2
+ --> $DIR/test.rs:18 :1
3
3
|
4
4
LL | / fn too_many_lines() {
5
5
LL | | println!("This is bad.");
@@ -10,7 +10,7 @@ LL | | }
10
10
= note: `-D clippy::too-many-lines` implied by `-D warnings`
11
11
12
12
error: This function has a large number of lines.
13
- --> $DIR/test.rs:37 :1
13
+ --> $DIR/test.rs:38 :1
14
14
|
15
15
LL | / fn comment_before_code() {
16
16
LL | | let _ = "test";
You can’t perform that action at this time.
0 commit comments