]> git.lizzy.rs Git - rust.git/commitdiff
clippy lint group
authorManish Goregaokar <manishsmail@gmail.com>
Thu, 25 Dec 2014 23:42:05 +0000 (05:12 +0530)
committerManish Goregaokar <manishsmail@gmail.com>
Thu, 25 Dec 2014 23:42:05 +0000 (05:12 +0530)
src/lib.rs
src/misc.rs
src/types.rs

index 9ac74eb2320b833e59728cafc583a9e6446a05c0..a70327c468bc9736844051dc3da727df57f1a637 100644 (file)
@@ -22,4 +22,7 @@ pub fn plugin_registrar(reg: &mut Registry) {
     reg.register_lint_pass(box misc::MiscPass as LintPassObject);
     reg.register_lint_pass(box misc::StrToStringPass as LintPassObject);
     reg.register_lint_pass(box misc::TopLevelRefPass as LintPassObject);
+    reg.register_lint_group("clippy", vec![types::CLIPPY_BOX_VEC, types::CLIPPY_DLIST,
+                                           misc::CLIPPY_SINGLE_MATCH, misc::CLIPPY_STR_TO_STRING,
+                                           misc::CLIPPY_TOPLEVEL_REF_ARG]);
 }
index 4fb0a159a8b9c701748c55684970d1152b3b1de1..77520e02da7123b280c5a6effb4f991b5b6f54af 100644 (file)
@@ -14,7 +14,7 @@
 pub struct MiscPass;
 
 
-declare_lint!(CLIPPY_SINGLE_MATCH, Warn,
+declare_lint!(pub CLIPPY_SINGLE_MATCH, Warn,
               "Warn on usage of matches with a single nontrivial arm");
 
 impl LintPass for MiscPass {
@@ -49,7 +49,7 @@ fn check_expr(&mut self, cx: &Context, expr: &Expr) {
 }
 
 
-declare_lint!(CLIPPY_STR_TO_STRING, Warn, "Warn when a String could use into_string() instead of to_string()");
+declare_lint!(pub CLIPPY_STR_TO_STRING, Warn, "Warn when a String could use into_string() instead of to_string()");
 
 #[allow(missing_copy_implementations)]
 pub struct StrToStringPass;
@@ -86,7 +86,7 @@ fn walk_ty<'t>(ty: ty::Ty<'t>) -> ty::Ty<'t> {
 }
 
 
-declare_lint!(CLIPPY_TOPLEVEL_REF_ARG, Warn, "Warn about pattern matches with top-level `ref` bindings");
+declare_lint!(pub CLIPPY_TOPLEVEL_REF_ARG, Warn, "Warn about pattern matches with top-level `ref` bindings");
 
 #[allow(missing_copy_implementations)]
 pub struct TopLevelRefPass;
index f2bedad56a2790d39e91f8cb88e7d6730b3ab4d9..c189e1c389c0faa5b179658bb10dddbfee64bae6 100644 (file)
@@ -10,9 +10,9 @@
 #[allow(missing_copy_implementations)]
 pub struct TypePass;
 
-declare_lint!(CLIPPY_BOX_VEC, Warn,
+declare_lint!(pub CLIPPY_BOX_VEC, Warn,
               "Warn on usage of Box<Vec<T>>");
-declare_lint!(CLIPPY_DLIST, Warn,
+declare_lint!(pub CLIPPY_DLIST, Warn,
               "Warn on usage of DList");
 
 /// Matches a type with a provided string, and returns its type parameters if successful