Enable lints on tests and extras; fix maud_doctype
lint not firing
This commit is contained in:
parent
366573c072
commit
f6c9e25722
8 changed files with 22 additions and 2 deletions
maud
maud_extras
maud_lints/src
|
@ -18,6 +18,9 @@ maud_macros = { version = "0.17.1", path = "../maud_macros" }
|
||||||
iron = { version = "0.5.1", optional = true }
|
iron = { version = "0.5.1", optional = true }
|
||||||
rocket = { version = "0.3", optional = true }
|
rocket = { version = "0.3", optional = true }
|
||||||
|
|
||||||
|
[dev-dependencies]
|
||||||
|
maud_lints = { path = "../maud_lints" }
|
||||||
|
|
||||||
[badges]
|
[badges]
|
||||||
travis-ci = { repository = "lfairy/maud" }
|
travis-ci = { repository = "lfairy/maud" }
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,8 @@
|
||||||
|
#![feature(plugin)]
|
||||||
#![feature(proc_macro)]
|
#![feature(proc_macro)]
|
||||||
|
|
||||||
|
#![plugin(maud_lints)]
|
||||||
|
|
||||||
extern crate maud;
|
extern crate maud;
|
||||||
|
|
||||||
use maud::{Markup, html};
|
use maud::{Markup, html};
|
||||||
|
|
|
@ -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;
|
extern crate maud;
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,8 @@
|
||||||
|
#![feature(plugin)]
|
||||||
#![feature(proc_macro)]
|
#![feature(proc_macro)]
|
||||||
|
|
||||||
|
#![plugin(maud_lints)]
|
||||||
|
|
||||||
extern crate maud;
|
extern crate maud;
|
||||||
|
|
||||||
use maud::html;
|
use maud::html;
|
||||||
|
|
|
@ -1,5 +1,8 @@
|
||||||
|
#![feature(plugin)]
|
||||||
#![feature(proc_macro)]
|
#![feature(proc_macro)]
|
||||||
|
|
||||||
|
#![plugin(maud_lints)]
|
||||||
|
|
||||||
extern crate maud;
|
extern crate maud;
|
||||||
|
|
||||||
use maud::html;
|
use maud::html;
|
||||||
|
|
|
@ -10,6 +10,7 @@ description = "Extra bits and pieces for use in Maud templates."
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
maud = { path = "../maud", features = ["iron"] }
|
maud = { path = "../maud", features = ["iron"] }
|
||||||
|
maud_lints = { path = "../maud_lints" }
|
||||||
|
|
||||||
[lib]
|
[lib]
|
||||||
path = "lib.rs"
|
path = "lib.rs"
|
||||||
|
|
|
@ -1,5 +1,8 @@
|
||||||
|
#![feature(plugin)]
|
||||||
#![feature(proc_macro)]
|
#![feature(proc_macro)]
|
||||||
|
|
||||||
|
#![plugin(maud_lints)]
|
||||||
|
|
||||||
extern crate maud;
|
extern crate maud;
|
||||||
|
|
||||||
use maud::{Markup, Render, html};
|
use maud::{Markup, Render, html};
|
||||||
|
|
|
@ -31,7 +31,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for Doctype {
|
||||||
// ... and the callee is `maud::PreEscaped`
|
// ... and the callee is `maud::PreEscaped`
|
||||||
if let ExprPath(ref qpath) = path_expr.node;
|
if let ExprPath(ref qpath) = path_expr.node;
|
||||||
let def_id = cx.tables.qpath_def(qpath, path_expr.hir_id).def_id();
|
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 {
|
then {
|
||||||
cx.struct_span_lint(MAUD_DOCTYPE, expr.span,
|
cx.struct_span_lint(MAUD_DOCTYPE, expr.span,
|
||||||
"use `maud::DOCTYPE` instead").emit();
|
"use `maud::DOCTYPE` instead").emit();
|
||||||
|
|
Loading…
Add table
Reference in a new issue