add rustfmt::skip attributes to some tests

This commit is contained in:
Matthias Krüger 2018-12-08 18:56:59 +01:00
parent 5b01f7a0d6
commit 4583d78156
12 changed files with 25 additions and 40 deletions

View file

@ -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;

View file

@ -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;

View file

@ -8,9 +8,7 @@
// except according to those terms.
#[rustfmt::skip]
#[warn(clippy::collapsible_if)]
fn main() {
let x = "hello";

View file

@ -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<i32, &'static str> {
return Ok(5);
}
#[rustfmt::skip]
#[clippy::cyclomatic_complexity = "0"]
fn early_ret() -> i32 {
let a = if true { 42 } else { return 0; };

View file

@ -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)]

View file

@ -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>(_: T) {}
struct DummyStruct;

View file

@ -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

View file

@ -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" {

View file

@ -8,7 +8,6 @@
// except according to those terms.
#![allow(clippy::print_literal)]
#![warn(clippy::useless_format)]

View file

@ -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;

View file

@ -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(); };

View file

@ -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<F: Fn() -> (), G>(&self, f: F, _g: G) ->
@ -33,6 +31,7 @@ impl Unitter {
}
impl Into<()> for Unitter {
#[rustfmt::skip]
fn into(self) -> () {
()
}