Skip to content

Add rustfmt::skip to double_parens tests #3829

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from Feb 28, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ci/base-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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/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/doc.rs" -not -path "tests/ui/unused_unit.rs" | grep "\.rs$"` ; do
rustfmt ${file} --check
if [ $? -ne 0 ]; then
echo "${file} needs reformatting!"
Expand Down
3 changes: 3 additions & 0 deletions tests/ui/double_parens.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
#![warn(clippy::double_parens)]
#![allow(dead_code)]
#![feature(custom_inner_attributes)]
#![rustfmt::skip]

fn dummy_fn<T>(_: T) {}

struct DummyStruct;
Expand Down
12 changes: 6 additions & 6 deletions tests/ui/double_parens.stderr
Original file line number Diff line number Diff line change
@@ -1,37 +1,37 @@
error: Consider removing unnecessary double parentheses
--> $DIR/double_parens.rs:12:5
--> $DIR/double_parens.rs:15:5
|
LL | ((0))
| ^^^^^
|
= note: `-D clippy::double-parens` implied by `-D warnings`

error: Consider removing unnecessary double parentheses
--> $DIR/double_parens.rs:16:14
--> $DIR/double_parens.rs:19:14
|
LL | dummy_fn((0));
| ^^^

error: Consider removing unnecessary double parentheses
--> $DIR/double_parens.rs:20:20
--> $DIR/double_parens.rs:23:20
|
LL | x.dummy_method((0));
| ^^^

error: Consider removing unnecessary double parentheses
--> $DIR/double_parens.rs:24:5
--> $DIR/double_parens.rs:27:5
|
LL | ((1, 2))
| ^^^^^^^^

error: Consider removing unnecessary double parentheses
--> $DIR/double_parens.rs:28:5
--> $DIR/double_parens.rs:31:5
|
LL | (())
| ^^^^

error: Consider removing unnecessary double parentheses
--> $DIR/double_parens.rs:50:16
--> $DIR/double_parens.rs:53:16
|
LL | assert_eq!(((1, 2)), (1, 2), "Error");
| ^^^^^^^^
Expand Down