]> git.lizzy.rs Git - rust.git/blob - src/lib.rs
split clippy into lints, plugin and cargo-clippy
[rust.git] / src / lib.rs
1 // error-pattern:cargo-clippy
2 #![feature(type_macros)]
3 #![feature(plugin_registrar, box_syntax)]
4 #![feature(rustc_private, collections)]
5 #![feature(custom_attribute)]
6 #![feature(slice_patterns)]
7 #![feature(question_mark)]
8 #![feature(stmt_expr_attributes)]
9 #![allow(indexing_slicing, shadow_reuse, unknown_lints)]
10
11 #[macro_use]
12 extern crate syntax;
13 #[macro_use]
14 extern crate rustc;
15
16 extern crate toml;
17
18 // Only for the compile time checking of paths
19 extern crate core;
20 extern crate collections;
21
22 // for unicode nfc normalization
23 extern crate unicode_normalization;
24
25 // for semver check in attrs.rs
26 extern crate semver;
27
28 // for regex checking
29 extern crate regex_syntax;
30
31 // for finding minimal boolean expressions
32 extern crate quine_mc_cluskey;
33
34 extern crate rustc_plugin;
35 extern crate rustc_const_eval;
36 extern crate rustc_const_math;
37 use rustc_plugin::Registry;
38
39 extern crate clippy_lints;
40
41 pub use clippy_lints::*;
42
43 macro_rules! declare_restriction_lint {
44     { pub $name:tt, $description:tt } => {
45         declare_lint! { pub $name, Allow, $description }
46     };
47 }
48
49 mod reexport {
50     pub use syntax::ast::{Name, NodeId};
51 }
52
53 #[plugin_registrar]
54 pub fn plugin_registrar(reg: &mut Registry) {
55     register_plugins(reg);
56 }
57
58 // only exists to let the dogfood integration test works.
59 // Don't run clippy as an executable directly
60 #[allow(dead_code, print_stdout)]
61 fn main() {
62     panic!("Please use the cargo-clippy executable");
63 }