Move lints into their own maud_lints crate
This commit is contained in:
parent
99ee994143
commit
3de5f7f3e9
8 changed files with 51 additions and 27 deletions
|
@ -11,7 +11,7 @@ script:
|
|||
- |
|
||||
if command -v cargo-clippy > /dev/null; then
|
||||
CLIPPY_STATUS=0
|
||||
for package in maud_htmlescape maud_macros maud maud_extras; do
|
||||
for package in maud_htmlescape maud_macros maud maud_lints maud_extras; do
|
||||
cargo clippy --manifest-path $package/Cargo.toml -- -D warnings || CLIPPY_STATUS=$?
|
||||
done
|
||||
(exit $CLIPPY_STATUS)
|
||||
|
|
|
@ -3,5 +3,6 @@ members = [
|
|||
"maud_htmlescape",
|
||||
"maud_macros",
|
||||
"maud",
|
||||
"maud_lints",
|
||||
"maud_extras",
|
||||
]
|
||||
|
|
22
maud_lints/Cargo.toml
Normal file
22
maud_lints/Cargo.toml
Normal file
|
@ -0,0 +1,22 @@
|
|||
[package]
|
||||
|
||||
name = "maud_lints"
|
||||
# When releasing a new version, please update html_root_url in src/lib.rs
|
||||
version = "0.17.0"
|
||||
authors = ["Chris Wong <lambda.fairy@gmail.com>"]
|
||||
|
||||
license = "MIT/Apache-2.0"
|
||||
documentation = "https://docs.rs/maud_lints/"
|
||||
homepage = "https://maud.lambda.xyz/"
|
||||
repository = "https://github.com/lfairy/maud"
|
||||
description = "Lint plugin for the Maud template engine."
|
||||
|
||||
[dependencies]
|
||||
if_chain = "0.1"
|
||||
|
||||
[lib]
|
||||
name = "maud_lints"
|
||||
plugin = true
|
||||
|
||||
[badges]
|
||||
travis-ci = { repository = "lfairy/maud" }
|
27
maud_lints/src/lib.rs
Normal file
27
maud_lints/src/lib.rs
Normal file
|
@ -0,0 +1,27 @@
|
|||
#![feature(plugin_registrar)]
|
||||
#![feature(rustc_private)]
|
||||
#![recursion_limit = "1000"] // if_chain
|
||||
|
||||
#![doc(html_root_url = "https://docs.rs/maud_lints/0.17.0")]
|
||||
|
||||
#[macro_use]
|
||||
extern crate if_chain;
|
||||
#[macro_use]
|
||||
extern crate rustc;
|
||||
extern crate rustc_plugin;
|
||||
extern crate syntax;
|
||||
|
||||
use rustc_plugin::Registry;
|
||||
|
||||
#[macro_use]
|
||||
mod util;
|
||||
|
||||
mod doctype;
|
||||
|
||||
#[plugin_registrar]
|
||||
pub fn plugin_registrar(reg: &mut Registry) {
|
||||
reg.register_late_lint_pass(Box::new(doctype::Doctype));
|
||||
reg.register_lint_group("maud", vec![
|
||||
doctype::MAUD_DOCTYPE,
|
||||
]);
|
||||
}
|
|
@ -1,5 +1,4 @@
|
|||
#![feature(proc_macro)]
|
||||
#![recursion_limit = "1000"] // if_chain
|
||||
|
||||
#![doc(html_root_url = "https://docs.rs/maud_macros/0.16.3")]
|
||||
|
||||
|
@ -7,8 +6,6 @@ extern crate literalext;
|
|||
extern crate maud_htmlescape;
|
||||
extern crate proc_macro;
|
||||
|
||||
// TODO move lints into their own `maud_lints` crate
|
||||
// mod lints;
|
||||
mod parse;
|
||||
mod render;
|
||||
|
||||
|
@ -34,12 +31,3 @@ pub fn html_debug(args: TokenStream) -> TokenStream {
|
|||
Err(e) => panic!(e),
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
#[plugin_registrar]
|
||||
pub fn plugin_registrar(reg: &mut Registry) {
|
||||
reg.register_macro("html", expand_html);
|
||||
reg.register_macro("html_debug", expand_html_debug);
|
||||
lints::register_lints(reg);
|
||||
}
|
||||
*/
|
||||
|
|
|
@ -1,14 +0,0 @@
|
|||
use rustc_plugin::Registry;
|
||||
|
||||
#[macro_use]
|
||||
mod util;
|
||||
|
||||
mod doctype;
|
||||
|
||||
pub fn register_lints(reg: &mut Registry) {
|
||||
reg.register_late_lint_pass(Box::new(doctype::Doctype));
|
||||
|
||||
reg.register_lint_group("maud", vec![
|
||||
doctype::MAUD_DOCTYPE,
|
||||
]);
|
||||
}
|
Loading…
Add table
Reference in a new issue