From 11682b4cd2a7ccc3f9d4a4007dd8d93397c86cbe Mon Sep 17 00:00:00 2001 From: Michael Wright Date: Wed, 27 Feb 2019 07:41:07 +0200 Subject: [PATCH] Add `rustfmt::skip` to outer attr format tests --- ci/base-tests.sh | 2 +- tests/ui/empty_line_after_outer_attribute.rs | 3 +++ tests/ui/empty_line_after_outer_attribute.stderr | 12 ++++++------ 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/ci/base-tests.sh b/ci/base-tests.sh index ff14072d5..37754972b 100755 --- a/ci/base-tests.sh +++ b/ci/base-tests.sh @@ -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!" diff --git a/tests/ui/empty_line_after_outer_attribute.rs b/tests/ui/empty_line_after_outer_attribute.rs index b43dc2008..5343dff9d 100644 --- a/tests/ui/empty_line_after_outer_attribute.rs +++ b/tests/ui/empty_line_after_outer_attribute.rs @@ -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"] diff --git a/tests/ui/empty_line_after_outer_attribute.stderr b/tests/ui/empty_line_after_outer_attribute.stderr index 0fb8dd8db..726923103 100644 --- a/tests/ui/empty_line_after_outer_attribute.stderr +++ b/tests/ui/empty_line_after_outer_attribute.stderr @@ -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 | |