Skip to content

Commit 11682b4

Browse files
author
Michael Wright
committed
Add rustfmt::skip to outer attr format tests
1 parent 6e8931c commit 11682b4

File tree

3 files changed

+10
-7
lines changed

3 files changed

+10
-7
lines changed

ci/base-tests.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ rustup override set nightly
5959
# avoid loop spam and allow cmds with exit status != 0
6060
set +ex
6161

62-
for file in `find tests -not -path "tests/ui/empty_line_after_outer_attribute.rs" -not -path "tests/ui/double_parens.rs" -not -path "tests/ui/doc.rs" -not -path "tests/ui/unused_unit.rs" | grep "\.rs$"` ; do
62+
for file in `find tests -not -path "tests/ui/double_parens.rs" -not -path "tests/ui/doc.rs" -not -path "tests/ui/unused_unit.rs" | grep "\.rs$"` ; do
6363
rustfmt ${file} --check
6464
if [ $? -ne 0 ]; then
6565
echo "${file} needs reformatting!"

tests/ui/empty_line_after_outer_attribute.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
#![warn(clippy::empty_line_after_outer_attr)]
22
#![allow(clippy::assertions_on_constants)]
3+
#![feature(custom_inner_attributes)]
4+
#![rustfmt::skip]
5+
36
// This should produce a warning
47
#[crate_type = "lib"]
58

tests/ui/empty_line_after_outer_attribute.stderr

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error: Found an empty line after an outer attribute. Perhaps you forgot to add a '!' to make it an inner attribute?
2-
--> $DIR/empty_line_after_outer_attribute.rs:4:1
2+
--> $DIR/empty_line_after_outer_attribute.rs:7:1
33
|
44
LL | / #[crate_type = "lib"]
55
LL | |
@@ -10,15 +10,15 @@ LL | | fn with_one_newline_and_comment() { assert!(true) }
1010
= note: `-D clippy::empty-line-after-outer-attr` implied by `-D warnings`
1111

1212
error: Found an empty line after an outer attribute. Perhaps you forgot to add a '!' to make it an inner attribute?
13-
--> $DIR/empty_line_after_outer_attribute.rs:16:1
13+
--> $DIR/empty_line_after_outer_attribute.rs:19:1
1414
|
1515
LL | / #[crate_type = "lib"]
1616
LL | |
1717
LL | | fn with_one_newline() { assert!(true) }
1818
| |_
1919

2020
error: Found an empty line after an outer attribute. Perhaps you forgot to add a '!' to make it an inner attribute?
21-
--> $DIR/empty_line_after_outer_attribute.rs:21:1
21+
--> $DIR/empty_line_after_outer_attribute.rs:24:1
2222
|
2323
LL | / #[crate_type = "lib"]
2424
LL | |
@@ -27,23 +27,23 @@ LL | | fn with_two_newlines() { assert!(true) }
2727
| |_
2828

2929
error: Found an empty line after an outer attribute. Perhaps you forgot to add a '!' to make it an inner attribute?
30-
--> $DIR/empty_line_after_outer_attribute.rs:28:1
30+
--> $DIR/empty_line_after_outer_attribute.rs:31:1
3131
|
3232
LL | / #[crate_type = "lib"]
3333
LL | |
3434
LL | | enum Baz {
3535
| |_
3636

3737
error: Found an empty line after an outer attribute. Perhaps you forgot to add a '!' to make it an inner attribute?
38-
--> $DIR/empty_line_after_outer_attribute.rs:36:1
38+
--> $DIR/empty_line_after_outer_attribute.rs:39:1
3939
|
4040
LL | / #[crate_type = "lib"]
4141
LL | |
4242
LL | | struct Foo {
4343
| |_
4444

4545
error: Found an empty line after an outer attribute. Perhaps you forgot to add a '!' to make it an inner attribute?
46-
--> $DIR/empty_line_after_outer_attribute.rs:44:1
46+
--> $DIR/empty_line_after_outer_attribute.rs:47:1
4747
|
4848
LL | / #[crate_type = "lib"]
4949
LL | |

0 commit comments

Comments
 (0)