Skip to content

Commit 4583d78

Browse files
committed
add rustfmt::skip attributes to some tests
1 parent 5b01f7a commit 4583d78

12 files changed

+25
-40
lines changed

tests/ui/absurd-extreme-comparisons.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,10 @@
77
// option. This file may not be copied, modified, or distributed
88
// except according to those terms.
99

10-
11-
12-
13-
1410
#![warn(clippy::absurd_extreme_comparisons)]
1511
#![allow(unused, clippy::eq_op, clippy::no_effect, clippy::unnecessary_operation, clippy::needless_pass_by_value)]
1612

13+
#[rustfmt::skip]
1714
fn main() {
1815
const Z: u32 = 0;
1916
let u: u32 = 42;

tests/ui/arithmetic.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,10 @@
88
// except according to those terms.
99

1010

11-
12-
13-
1411
#![warn(clippy::integer_arithmetic, clippy::float_arithmetic)]
1512
#![allow(unused, clippy::shadow_reuse, clippy::shadow_unrelated, clippy::no_effect, clippy::unnecessary_operation)]
13+
14+
#[rustfmt::skip]
1615
fn main() {
1716
let i = 1i32;
1817
1 + i;

tests/ui/collapsible_if.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,7 @@
88
// except according to those terms.
99

1010

11-
12-
13-
11+
#[rustfmt::skip]
1412
#[warn(clippy::collapsible_if)]
1513
fn main() {
1614
let x = "hello";

tests/ui/cyclomatic_complexity.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,11 @@
88
// except according to those terms.
99

1010

11-
12-
1311
#![allow(clippy::all)]
1412
#![warn(clippy::cyclomatic_complexity)]
1513
#![allow(unused)]
1614

15+
#[rustfmt::skip]
1716
fn main() {
1817
if true {
1918
println!("a");
@@ -362,6 +361,7 @@ fn early() -> Result<i32, &'static str> {
362361
return Ok(5);
363362
}
364363

364+
#[rustfmt::skip]
365365
#[clippy::cyclomatic_complexity = "0"]
366366
fn early_ret() -> i32 {
367367
let a = if true { 42 } else { return 0; };

tests/ui/doc.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,8 @@
77
// option. This file may not be copied, modified, or distributed
88
// except according to those terms.
99

10-
11-
12-
1310
//! This file tests for the DOC_MARKDOWN lint
1411
15-
16-
1712
#![allow(dead_code)]
1813
#![warn(clippy::doc_markdown)]
1914

tests/ui/double_parens.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,8 @@
77
// option. This file may not be copied, modified, or distributed
88
// except according to those terms.
99

10-
11-
12-
13-
1410
#![warn(clippy::double_parens)]
1511
#![allow(dead_code)]
16-
1712
fn dummy_fn<T>(_: T) {}
1813

1914
struct DummyStruct;

tests/ui/empty_line_after_outer_attribute.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@
77
// option. This file may not be copied, modified, or distributed
88
// except according to those terms.
99

10-
11-
1210
#![warn(clippy::empty_line_after_outer_attr)]
1311

1412
// This should produce a warning

tests/ui/eq_op.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,7 @@
77
// option. This file may not be copied, modified, or distributed
88
// except according to those terms.
99

10-
11-
12-
13-
10+
#[rustfmt::skip]
1411
#[warn(clippy::eq_op)]
1512
#[allow(clippy::identity_op, clippy::double_parens, clippy::many_single_char_names)]
1613
#[allow(clippy::no_effect, unused_variables, clippy::unnecessary_operation, clippy::short_circuit_statement)]
@@ -107,6 +104,7 @@ fn main() {
107104
const D: u32 = A / A;
108105
}
109106

107+
#[rustfmt::skip]
110108
macro_rules! check_if_named_foo {
111109
($expression:expr) => (
112110
if stringify!($expression) == "foo" {

tests/ui/format.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
// except according to those terms.
99

1010

11-
1211
#![allow(clippy::print_literal)]
1312
#![warn(clippy::useless_format)]
1413

tests/ui/methods.rs

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,21 @@
77
// option. This file may not be copied, modified, or distributed
88
// except according to those terms.
99

10-
11-
12-
13-
1410
#![warn(clippy::all, clippy::pedantic, clippy::option_unwrap_used)]
15-
#![allow(clippy::blacklisted_name, unused, clippy::print_stdout, clippy::non_ascii_literal, clippy::new_without_default,
16-
clippy::new_without_default_derive, clippy::missing_docs_in_private_items, clippy::needless_pass_by_value,
17-
clippy::default_trait_access, clippy::use_self, clippy::new_ret_no_self, clippy::useless_format)]
11+
#![allow(
12+
clippy::blacklisted_name,
13+
unused,
14+
clippy::print_stdout,
15+
clippy::non_ascii_literal,
16+
clippy::new_without_default,
17+
clippy::new_without_default_derive,
18+
clippy::missing_docs_in_private_items,
19+
clippy::needless_pass_by_value,
20+
clippy::default_trait_access,
21+
clippy::use_self,
22+
clippy::new_ret_no_self,
23+
clippy::useless_format
24+
)]
1825

1926
use std::collections::BTreeMap;
2027
use std::collections::HashMap;

tests/ui/replace_consts.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,14 @@
88
// except according to those terms.
99

1010

11-
12-
1311
#![feature(integer_atomics)]
1412
#![allow(clippy::blacklisted_name)]
1513
#![deny(clippy::replace_consts)]
1614

1715
use std::sync::atomic::*;
1816
use std::sync::{ONCE_INIT, Once};
1917

18+
#[rustfmt::skip]
2019
fn bad() {
2120
// Once
2221
{ let foo = ONCE_INIT; };
@@ -60,6 +59,7 @@ fn bad() {
6059
{ let foo = std::u128::MAX; };
6160
}
6261

62+
#[rustfmt::skip]
6363
fn good() {
6464
// Once
6565
{ let foo = Once::new(); };

tests/ui/unused_unit.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,10 @@
1616
// stripping away any starting or ending parenthesis characters—hence this
1717
// test of the JSON error format.
1818

19-
2019
#![deny(clippy::unused_unit)]
2120
#![allow(clippy::needless_return)]
2221

2322
struct Unitter;
24-
2523
impl Unitter {
2624
// try to disorient the lint with multiple unit returns and newlines
2725
pub fn get_unit<F: Fn() -> (), G>(&self, f: F, _g: G) ->
@@ -33,6 +31,7 @@ impl Unitter {
3331
}
3432

3533
impl Into<()> for Unitter {
34+
#[rustfmt::skip]
3635
fn into(self) -> () {
3736
()
3837
}

0 commit comments

Comments
 (0)