Enable lints on tests and extras; fix maud_doctype lint not firing

This commit is contained in:
Chris Wong 2017-10-07 14:45:06 +13:00
parent 366573c072
commit f6c9e25722
8 changed files with 22 additions and 2 deletions

View file

@ -18,6 +18,9 @@ maud_macros = { version = "0.17.1", path = "../maud_macros" }
iron = { version = "0.5.1", optional = true }
rocket = { version = "0.3", optional = true }
[dev-dependencies]
maud_lints = { path = "../maud_lints" }
[badges]
travis-ci = { repository = "lfairy/maud" }

View file

@ -1,5 +1,8 @@
#![feature(plugin)]
#![feature(proc_macro)]
#![plugin(maud_lints)]
extern crate maud;
use maud::{Markup, html};

View file

@ -1,4 +1,8 @@
#![feature(conservative_impl_trait, proc_macro)]
#![feature(conservative_impl_trait)]
#![feature(plugin)]
#![feature(proc_macro)]
#![plugin(maud_lints)]
extern crate maud;

View file

@ -1,5 +1,8 @@
#![feature(plugin)]
#![feature(proc_macro)]
#![plugin(maud_lints)]
extern crate maud;
use maud::html;

View file

@ -1,5 +1,8 @@
#![feature(plugin)]
#![feature(proc_macro)]
#![plugin(maud_lints)]
extern crate maud;
use maud::html;

View file

@ -10,6 +10,7 @@ description = "Extra bits and pieces for use in Maud templates."
[dependencies]
maud = { path = "../maud", features = ["iron"] }
maud_lints = { path = "../maud_lints" }
[lib]
path = "lib.rs"

View file

@ -1,5 +1,8 @@
#![feature(plugin)]
#![feature(proc_macro)]
#![plugin(maud_lints)]
extern crate maud;
use maud::{Markup, Render, html};

View file

@ -31,7 +31,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for Doctype {
// ... and the callee is `maud::PreEscaped`
if let ExprPath(ref qpath) = path_expr.node;
let def_id = cx.tables.qpath_def(qpath, path_expr.hir_id).def_id();
if match_def_path(cx, def_id, &["maud", "PreEscaped", "{{constructor}}"]);
if match_def_path(cx, def_id, &["maud", "PreEscaped"]);
then {
cx.struct_span_lint(MAUD_DOCTYPE, expr.span,
"use `maud::DOCTYPE` instead").emit();