From 4583d781562a1cff374992f64f85e9113391acd3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20Kr=C3=BCger?= Date: Sat, 8 Dec 2018 18:56:59 +0100 Subject: [PATCH] add rustfmt::skip attributes to some tests --- tests/ui/absurd-extreme-comparisons.rs | 5 +---- tests/ui/arithmetic.rs | 5 ++--- tests/ui/collapsible_if.rs | 4 +--- tests/ui/cyclomatic_complexity.rs | 4 ++-- tests/ui/doc.rs | 5 ----- tests/ui/double_parens.rs | 5 ----- tests/ui/empty_line_after_outer_attribute.rs | 2 -- tests/ui/eq_op.rs | 6 ++---- tests/ui/format.rs | 1 - tests/ui/methods.rs | 21 +++++++++++++------- tests/ui/replace_consts.rs | 4 ++-- tests/ui/unused_unit.rs | 3 +-- 12 files changed, 25 insertions(+), 40 deletions(-) diff --git a/tests/ui/absurd-extreme-comparisons.rs b/tests/ui/absurd-extreme-comparisons.rs index b219cb039..a93027162 100644 --- a/tests/ui/absurd-extreme-comparisons.rs +++ b/tests/ui/absurd-extreme-comparisons.rs @@ -7,13 +7,10 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. - - - - #![warn(clippy::absurd_extreme_comparisons)] #![allow(unused, clippy::eq_op, clippy::no_effect, clippy::unnecessary_operation, clippy::needless_pass_by_value)] +#[rustfmt::skip] fn main() { const Z: u32 = 0; let u: u32 = 42; diff --git a/tests/ui/arithmetic.rs b/tests/ui/arithmetic.rs index 61a601468..39aef5a4a 100644 --- a/tests/ui/arithmetic.rs +++ b/tests/ui/arithmetic.rs @@ -8,11 +8,10 @@ // except according to those terms. - - - #![warn(clippy::integer_arithmetic, clippy::float_arithmetic)] #![allow(unused, clippy::shadow_reuse, clippy::shadow_unrelated, clippy::no_effect, clippy::unnecessary_operation)] + +#[rustfmt::skip] fn main() { let i = 1i32; 1 + i; diff --git a/tests/ui/collapsible_if.rs b/tests/ui/collapsible_if.rs index a8ec13ab6..bd6e0c079 100644 --- a/tests/ui/collapsible_if.rs +++ b/tests/ui/collapsible_if.rs @@ -8,9 +8,7 @@ // except according to those terms. - - - +#[rustfmt::skip] #[warn(clippy::collapsible_if)] fn main() { let x = "hello"; diff --git a/tests/ui/cyclomatic_complexity.rs b/tests/ui/cyclomatic_complexity.rs index 35451a99a..a9a2391f1 100644 --- a/tests/ui/cyclomatic_complexity.rs +++ b/tests/ui/cyclomatic_complexity.rs @@ -8,12 +8,11 @@ // except according to those terms. - - #![allow(clippy::all)] #![warn(clippy::cyclomatic_complexity)] #![allow(unused)] +#[rustfmt::skip] fn main() { if true { println!("a"); @@ -362,6 +361,7 @@ fn early() -> Result { return Ok(5); } +#[rustfmt::skip] #[clippy::cyclomatic_complexity = "0"] fn early_ret() -> i32 { let a = if true { 42 } else { return 0; }; diff --git a/tests/ui/doc.rs b/tests/ui/doc.rs index d87142e93..dde1a471e 100644 --- a/tests/ui/doc.rs +++ b/tests/ui/doc.rs @@ -7,13 +7,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. - - - //! This file tests for the DOC_MARKDOWN lint - - #![allow(dead_code)] #![warn(clippy::doc_markdown)] diff --git a/tests/ui/double_parens.rs b/tests/ui/double_parens.rs index be1676a74..773179b2d 100644 --- a/tests/ui/double_parens.rs +++ b/tests/ui/double_parens.rs @@ -7,13 +7,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. - - - - #![warn(clippy::double_parens)] #![allow(dead_code)] - fn dummy_fn(_: T) {} struct DummyStruct; diff --git a/tests/ui/empty_line_after_outer_attribute.rs b/tests/ui/empty_line_after_outer_attribute.rs index 43105b6e3..ede1244df 100644 --- a/tests/ui/empty_line_after_outer_attribute.rs +++ b/tests/ui/empty_line_after_outer_attribute.rs @@ -7,8 +7,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. - - #![warn(clippy::empty_line_after_outer_attr)] // This should produce a warning diff --git a/tests/ui/eq_op.rs b/tests/ui/eq_op.rs index 36c54b0f4..020c7d795 100644 --- a/tests/ui/eq_op.rs +++ b/tests/ui/eq_op.rs @@ -7,10 +7,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. - - - - +#[rustfmt::skip] #[warn(clippy::eq_op)] #[allow(clippy::identity_op, clippy::double_parens, clippy::many_single_char_names)] #[allow(clippy::no_effect, unused_variables, clippy::unnecessary_operation, clippy::short_circuit_statement)] @@ -107,6 +104,7 @@ fn main() { const D: u32 = A / A; } +#[rustfmt::skip] macro_rules! check_if_named_foo { ($expression:expr) => ( if stringify!($expression) == "foo" { diff --git a/tests/ui/format.rs b/tests/ui/format.rs index e314d3022..6b1577e24 100644 --- a/tests/ui/format.rs +++ b/tests/ui/format.rs @@ -8,7 +8,6 @@ // except according to those terms. - #![allow(clippy::print_literal)] #![warn(clippy::useless_format)] diff --git a/tests/ui/methods.rs b/tests/ui/methods.rs index 03bd7e1f0..877026d4b 100644 --- a/tests/ui/methods.rs +++ b/tests/ui/methods.rs @@ -7,14 +7,21 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. - - - - #![warn(clippy::all, clippy::pedantic, clippy::option_unwrap_used)] -#![allow(clippy::blacklisted_name, unused, clippy::print_stdout, clippy::non_ascii_literal, clippy::new_without_default, - clippy::new_without_default_derive, clippy::missing_docs_in_private_items, clippy::needless_pass_by_value, - clippy::default_trait_access, clippy::use_self, clippy::new_ret_no_self, clippy::useless_format)] +#![allow( + clippy::blacklisted_name, + unused, + clippy::print_stdout, + clippy::non_ascii_literal, + clippy::new_without_default, + clippy::new_without_default_derive, + clippy::missing_docs_in_private_items, + clippy::needless_pass_by_value, + clippy::default_trait_access, + clippy::use_self, + clippy::new_ret_no_self, + clippy::useless_format +)] use std::collections::BTreeMap; use std::collections::HashMap; diff --git a/tests/ui/replace_consts.rs b/tests/ui/replace_consts.rs index 7a2584f17..7da1f212a 100644 --- a/tests/ui/replace_consts.rs +++ b/tests/ui/replace_consts.rs @@ -8,8 +8,6 @@ // except according to those terms. - - #![feature(integer_atomics)] #![allow(clippy::blacklisted_name)] #![deny(clippy::replace_consts)] @@ -17,6 +15,7 @@ use std::sync::atomic::*; use std::sync::{ONCE_INIT, Once}; +#[rustfmt::skip] fn bad() { // Once { let foo = ONCE_INIT; }; @@ -60,6 +59,7 @@ fn bad() { { let foo = std::u128::MAX; }; } +#[rustfmt::skip] fn good() { // Once { let foo = Once::new(); }; diff --git a/tests/ui/unused_unit.rs b/tests/ui/unused_unit.rs index 3930eecf1..88f0b9687 100644 --- a/tests/ui/unused_unit.rs +++ b/tests/ui/unused_unit.rs @@ -16,12 +16,10 @@ // stripping away any starting or ending parenthesis characters—hence this // test of the JSON error format. - #![deny(clippy::unused_unit)] #![allow(clippy::needless_return)] struct Unitter; - impl Unitter { // try to disorient the lint with multiple unit returns and newlines pub fn get_unit (), G>(&self, f: F, _g: G) -> @@ -33,6 +31,7 @@ impl Unitter { } impl Into<()> for Unitter { + #[rustfmt::skip] fn into(self) -> () { () }