mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-11-23 21:23:56 +00:00
add rustfmt::skip attributes to some tests
This commit is contained in:
parent
5b01f7a0d6
commit
4583d78156
12 changed files with 25 additions and 40 deletions
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -8,9 +8,7 @@
|
|||
// except according to those terms.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#[rustfmt::skip]
|
||||
#[warn(clippy::collapsible_if)]
|
||||
fn main() {
|
||||
let x = "hello";
|
||||
|
|
|
@ -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; };
|
||||
|
|
|
@ -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)]
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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" {
|
||||
|
|
|
@ -8,7 +8,6 @@
|
|||
// except according to those terms.
|
||||
|
||||
|
||||
|
||||
#![allow(clippy::print_literal)]
|
||||
#![warn(clippy::useless_format)]
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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(); };
|
||||
|
|
|
@ -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) -> () {
|
||||
()
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue