Skip to content

Commit

Permalink
Remove all mention and testing of #[plugin(clippy)] and warn if used
Browse files Browse the repository at this point in the history
  • Loading branch information
oli-obk committed May 11, 2018
1 parent 654ff18 commit fd8a1d2
Show file tree
Hide file tree
Showing 43 changed files with 39 additions and 122 deletions.
8 changes: 1 addition & 7 deletions CONTRIBUTING.md
Expand Up @@ -151,13 +151,7 @@ Therefore you should use `tests/ui/update-all-references.sh` (after running
Manually testing against an example file is useful if you have added some
`println!`s and test suite output becomes unreadable. To try clippy with your
local modifications, run `cargo run --bin clippy-driver -- -L ./target/debug input.rs` from the
working copy root. Your test file, here `input.rs`, needs to have clippy
enabled as a plugin:

```rust
#![feature(plugin)]
#![plugin(clippy)]
```
working copy root.

### How Clippy works

Expand Down
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -73,7 +73,7 @@ SYSROOT=/path/to/rustc/sysroot cargo install clippy

### Running clippy from the command line without installing it

To have cargo compile your crate with clippy without clippy installation and without needing `#![plugin(clippy)]`
To have cargo compile your crate with clippy without clippy installation
in your code, you can use:

```terminal
Expand Down
7 changes: 4 additions & 3 deletions src/lib.rs
Expand Up @@ -14,10 +14,11 @@ extern crate clippy_lints;
pub fn plugin_registrar(reg: &mut Registry) {
reg.sess.lint_store.with_read_lock(|lint_store| {
for (lint, _, _) in lint_store.get_lint_groups() {
reg.sess
.struct_warn("the clippy plugin is being deprecated, please use cargo clippy or rls with the clippy feature")
.emit();
if lint == "clippy" {
reg.sess
.struct_warn("running cargo clippy on a crate that also imports the clippy plugin")
.emit();
// cargo clippy run on a crate that also uses the plugin
return;
}
}
Expand Down
2 changes: 0 additions & 2 deletions tests/conf_whitelisted.rs

This file was deleted.

7 changes: 3 additions & 4 deletions tests/cc_seme.rs → tests/run-pass/cc_seme.rs
@@ -1,6 +1,3 @@
#![feature(plugin)]
#![plugin(clippy)]

#[allow(dead_code)]
enum Baz {
One,
Expand All @@ -12,7 +9,9 @@ struct Test {
b: Baz,
}

fn main() {
fn main() { }

pub fn foo() {
use Baz::*;
let x = Test { t: Some(0), b: One };

Expand Down
@@ -1,5 +1,3 @@
#![feature(plugin)]
#![plugin(clippy)]
#![deny(clippy)]

#[allow(dead_code)]
Expand All @@ -15,3 +13,5 @@ impl Iterator for Foo {
}

impl ExactSizeIterator for Foo {}

fn main() {}
2 changes: 0 additions & 2 deletions tests/issue-825.rs → tests/run-pass/issue-825.rs
@@ -1,5 +1,3 @@
#![feature(plugin)]
#![plugin(clippy)]
#![allow(warnings)]

// this should compile in a reasonable amount of time
Expand Down
11 changes: 6 additions & 5 deletions tests/mut_mut_macro.rs → tests/run-pass/mut_mut_macro.rs
@@ -1,12 +1,11 @@
#![feature(plugin)]
#![plugin(clippy)]
#![deny(mut_mut, zero_ptr, cmp_nan)]
#![allow(dead_code)]

#[macro_use]
extern crate lazy_static;
// compiletest + extern crates doesn't work together
//#[macro_use]
//extern crate lazy_static;

use std::collections::HashMap;
//use std::collections::HashMap;

// ensure that we don't suggest `is_nan` and `is_null` inside constants
// FIXME: once const fn is stable, suggest these functions again in constants
Expand All @@ -17,6 +16,7 @@ static mut BUH: bool = 42.0 < std::f32::NAN;

#[allow(unused_variables, unused_mut)]
fn main() {
/*
lazy_static! {
static ref MUT_MAP : HashMap<usize, &'static str> = {
let mut m = HashMap::new();
Expand All @@ -26,6 +26,7 @@ fn main() {
static ref MUT_COUNT : usize = MUT_MAP.len();
}
assert_eq!(*MUT_COUNT, 1);
*/
// FIXME: don't lint in array length, requires `check_body`
//let _ = [""; (42.0 < std::f32::NAN) as usize];
}
@@ -1,5 +1,5 @@
#![feature(plugin)]
#![plugin(clippy)]



#[macro_use]
extern crate serde_derive;
Expand All @@ -16,3 +16,5 @@ struct MacroAttributesTest {
fn macro_attributes_test() {
let _ = MacroAttributesTest { _foo: 0 };
}

fn main() {}
File renamed without changes.
1 change: 1 addition & 0 deletions tests/run-pass/whitelist/conf_whitelisted.rs
@@ -0,0 +1 @@
fn main() {}
File renamed without changes.
@@ -1,6 +1,6 @@
// error-pattern: error reading Clippy's configuration file


#![plugin(clippy(conf_file="../ui/conf_bad_toml.toml"))]


fn main() {}
Empty file.
File renamed without changes.
@@ -1,6 +1,6 @@
// error-pattern: error reading Clippy's configuration file: `blacklisted-names` is expected to be a `Vec < String >` but is a `integer`


#![plugin(clippy(conf_file="../ui/conf_bad_type.toml"))]


fn main() {}
Empty file.
6 changes: 0 additions & 6 deletions tests/ui/conf_bad_arg.rs

This file was deleted.

11 changes: 0 additions & 11 deletions tests/ui/conf_bad_arg.stderr

This file was deleted.

11 changes: 0 additions & 11 deletions tests/ui/conf_bad_toml.stderr

This file was deleted.

11 changes: 0 additions & 11 deletions tests/ui/conf_bad_type.stderr

This file was deleted.

11 changes: 0 additions & 11 deletions tests/ui/conf_french_blacklisted_name.stderr

This file was deleted.

5 changes: 0 additions & 5 deletions tests/ui/conf_path_non_string.rs

This file was deleted.

11 changes: 0 additions & 11 deletions tests/ui/conf_path_non_string.stderr

This file was deleted.

11 changes: 0 additions & 11 deletions tests/ui/conf_unknown_key.stderr

This file was deleted.

2 changes: 1 addition & 1 deletion tests/ui/cyclomatic_complexity.rs
@@ -1,4 +1,4 @@
#![feature(plugin, custom_attribute)]
#![feature(custom_attribute)]

#![allow(clippy)]
#![warn(cyclomatic_complexity)]
Expand Down
2 changes: 1 addition & 1 deletion tests/ui/cyclomatic_complexity_attr_used.rs
@@ -1,4 +1,4 @@
#![feature(plugin, custom_attribute)]
#![feature(custom_attribute)]

#![warn(cyclomatic_complexity)]
#![warn(unused)]
Expand Down
2 changes: 1 addition & 1 deletion tests/ui/diverging_sub_expression.rs
@@ -1,4 +1,4 @@
#![feature(plugin, never_type)]
#![feature(never_type)]

#![warn(diverging_sub_expression)]
#![allow(match_same_arms, logic_bug)]
Expand Down
2 changes: 1 addition & 1 deletion tests/ui/dlist.rs
@@ -1,4 +1,4 @@
#![feature(plugin, alloc)]
#![feature(alloc)]
#![feature(associated_type_defaults)]


Expand Down
2 changes: 1 addition & 1 deletion tests/ui/enum_variants.rs
@@ -1,4 +1,4 @@
#![feature(plugin, non_ascii_idents)]
#![feature(non_ascii_idents)]

#![warn(clippy, pub_enum_variant_names)]

Expand Down
2 changes: 1 addition & 1 deletion tests/ui/escape_analysis.rs
@@ -1,4 +1,4 @@
#![feature(plugin, box_syntax)]
#![feature(box_syntax)]

#![allow(warnings, clippy)]

Expand Down
2 changes: 1 addition & 1 deletion tests/ui/excessive_precision.rs
@@ -1,4 +1,4 @@
#![feature(plugin, custom_attribute)]
#![feature(custom_attribute)]
#![warn(excessive_precision)]
#![allow(print_literal)]

Expand Down
2 changes: 1 addition & 1 deletion tests/ui/for_loop.rs
@@ -1,4 +1,4 @@
#![feature(plugin, custom_attribute)]
#![feature(custom_attribute)]


use std::collections::*;
Expand Down
4 changes: 2 additions & 2 deletions tests/ui/mut_mut.rs
Expand Up @@ -4,8 +4,8 @@
#![allow(unused, no_effect, unnecessary_operation)]
#![warn(mut_mut)]

//#![plugin(regex_macros)]
//extern crate regex;



fn fun(x : &mut &mut u32) -> bool {
**x > 0
Expand Down
2 changes: 1 addition & 1 deletion tests/ui/new_without_default.rs
@@ -1,4 +1,4 @@
#![feature(plugin, const_fn)]
#![feature(const_fn)]


#![allow(dead_code)]
Expand Down
2 changes: 1 addition & 1 deletion tests/ui/no_effect.rs
@@ -1,4 +1,4 @@
#![feature(plugin, box_syntax)]
#![feature(box_syntax)]


#![warn(no_effect, unnecessary_operation)]
Expand Down
File renamed without changes.
@@ -1,5 +1,5 @@

#![plugin(clippy(conf_file="../auxiliary/conf_french_blacklisted_name.toml"))]


#![allow(dead_code)]
#![allow(single_match)]
Expand Down
Empty file.
File renamed without changes.
@@ -1,6 +1,6 @@
// error-pattern: error reading Clippy's configuration file: unknown key `foobar`


#![plugin(clippy(conf_file="../auxiliary/conf_unknown_key.toml"))]


fn main() {}
Empty file.
2 changes: 1 addition & 1 deletion tests/ui/trailing_zeros.rs
@@ -1,4 +1,4 @@
#![feature(plugin, custom_attribute, stmt_expr_attributes)]
#![feature(custom_attribute, stmt_expr_attributes)]

#![allow(unused_parens)]

Expand Down

0 comments on commit fd8a1d2

Please sign in to comment.