Auto merge of #3826 - mikerite:rustfmt-outer-attr-tests, r=phansch

Add `rustfmt::skip` to outer attr format tests
This commit is contained in:
bors 2019-02-27 06:49:09 +00:00
commit 58c0dc1db6
3 changed files with 10 additions and 7 deletions

View file

@ -59,7 +59,7 @@ rustup override set nightly
# avoid loop spam and allow cmds with exit status != 0
set +ex
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
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
rustfmt ${file} --check
if [ $? -ne 0 ]; then
echo "${file} needs reformatting!"

View file

@ -1,5 +1,8 @@
#![warn(clippy::empty_line_after_outer_attr)]
#![allow(clippy::assertions_on_constants)]
#![feature(custom_inner_attributes)]
#![rustfmt::skip]
// This should produce a warning
#[crate_type = "lib"]

View file

@ -1,5 +1,5 @@
error: Found an empty line after an outer attribute. Perhaps you forgot to add a '!' to make it an inner attribute?
--> $DIR/empty_line_after_outer_attribute.rs:4:1
--> $DIR/empty_line_after_outer_attribute.rs:7:1
|
LL | / #[crate_type = "lib"]
LL | |
@ -10,7 +10,7 @@ LL | | fn with_one_newline_and_comment() { assert!(true) }
= note: `-D clippy::empty-line-after-outer-attr` implied by `-D warnings`
error: Found an empty line after an outer attribute. Perhaps you forgot to add a '!' to make it an inner attribute?
--> $DIR/empty_line_after_outer_attribute.rs:16:1
--> $DIR/empty_line_after_outer_attribute.rs:19:1
|
LL | / #[crate_type = "lib"]
LL | |
@ -18,7 +18,7 @@ LL | | fn with_one_newline() { assert!(true) }
| |_
error: Found an empty line after an outer attribute. Perhaps you forgot to add a '!' to make it an inner attribute?
--> $DIR/empty_line_after_outer_attribute.rs:21:1
--> $DIR/empty_line_after_outer_attribute.rs:24:1
|
LL | / #[crate_type = "lib"]
LL | |
@ -27,7 +27,7 @@ LL | | fn with_two_newlines() { assert!(true) }
| |_
error: Found an empty line after an outer attribute. Perhaps you forgot to add a '!' to make it an inner attribute?
--> $DIR/empty_line_after_outer_attribute.rs:28:1
--> $DIR/empty_line_after_outer_attribute.rs:31:1
|
LL | / #[crate_type = "lib"]
LL | |
@ -35,7 +35,7 @@ LL | | enum Baz {
| |_
error: Found an empty line after an outer attribute. Perhaps you forgot to add a '!' to make it an inner attribute?
--> $DIR/empty_line_after_outer_attribute.rs:36:1
--> $DIR/empty_line_after_outer_attribute.rs:39:1
|
LL | / #[crate_type = "lib"]
LL | |
@ -43,7 +43,7 @@ LL | | struct Foo {
| |_
error: Found an empty line after an outer attribute. Perhaps you forgot to add a '!' to make it an inner attribute?
--> $DIR/empty_line_after_outer_attribute.rs:44:1
--> $DIR/empty_line_after_outer_attribute.rs:47:1
|
LL | / #[crate_type = "lib"]
LL | |