mirror of
https://github.com/servo/servo.git
synced 2025-07-22 14:53:49 +01:00
Improve mach clippy, add plugins to style/util
This commit is contained in:
parent
ed894777a1
commit
3ead9cc67b
8 changed files with 28 additions and 8 deletions
|
@ -44,12 +44,14 @@ mod utils;
|
|||
#[plugin_registrar]
|
||||
pub fn plugin_registrar(reg: &mut Registry) {
|
||||
reg.register_syntax_extension(intern("dom_struct"), MultiModifier(box jstraceable::expand_dom_struct));
|
||||
reg.register_syntax_extension(intern("derive_JSTraceable"), MultiDecorator(box jstraceable::expand_jstraceable));
|
||||
reg.register_syntax_extension(intern("_generate_reflector"), MultiDecorator(box reflector::expand_reflector));
|
||||
reg.register_late_lint_pass(box lints::transmute_type::TransmutePass);
|
||||
reg.register_syntax_extension(intern("derive_JSTraceable"),
|
||||
MultiDecorator(box jstraceable::expand_jstraceable));
|
||||
reg.register_syntax_extension(intern("_generate_reflector"),
|
||||
MultiDecorator(box reflector::expand_reflector));
|
||||
reg.register_late_lint_pass(box lints::unrooted_must_root::UnrootedPass::new());
|
||||
reg.register_late_lint_pass(box lints::privatize::PrivatizePass);
|
||||
reg.register_late_lint_pass(box lints::inheritance_integrity::InheritancePass);
|
||||
reg.register_late_lint_pass(box lints::transmute_type::TransmutePass);
|
||||
reg.register_early_lint_pass(box lints::ban::BanPass);
|
||||
reg.register_late_lint_pass(box tenacious::TenaciousPass);
|
||||
reg.register_attribute("must_root".to_string(), Whitelisted);
|
||||
|
|
2
components/servo/Cargo.lock
generated
2
components/servo/Cargo.lock
generated
|
@ -2240,6 +2240,7 @@ dependencies = [
|
|||
"log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"matches 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"num-traits 0.1.32 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"plugins 0.0.1",
|
||||
"rand 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"rustc-serialize 0.3.19 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"selectors 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
|
@ -2464,6 +2465,7 @@ dependencies = [
|
|||
"lazy_static 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"num_cpus 0.2.13 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"plugins 0.0.1",
|
||||
"rustc-serialize 0.3.19 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"serde 0.7.11 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"serde_macros 0.7.11 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
|
|
|
@ -16,7 +16,7 @@ servo = ["serde", "serde/nightly", "serde_macros", "heapsize", "heapsize_plugin"
|
|||
"style_traits/servo", "app_units/plugins", "euclid/plugins",
|
||||
"cssparser/heap_size", "cssparser/serde-serialization",
|
||||
"selectors/heap_size", "selectors/unstable", "string_cache/heap_size",
|
||||
"url/heap_size"]
|
||||
"url/heap_size", "plugins"]
|
||||
|
||||
[dependencies]
|
||||
app_units = "0.2.5"
|
||||
|
@ -45,6 +45,7 @@ style_traits = {path = "../style_traits"}
|
|||
time = "0.1"
|
||||
url = "1.0.0"
|
||||
util = {path = "../util"}
|
||||
plugins = {path = "../plugins", optional = true}
|
||||
|
||||
[target.'cfg(windows)'.dependencies]
|
||||
kernel32-sys = "0.2"
|
||||
|
|
|
@ -27,6 +27,7 @@
|
|||
#![cfg_attr(feature = "servo", feature(custom_derive))]
|
||||
#![cfg_attr(feature = "servo", feature(plugin))]
|
||||
#![cfg_attr(feature = "servo", plugin(heapsize_plugin))]
|
||||
#![cfg_attr(feature = "servo", plugin(plugins))]
|
||||
#![cfg_attr(feature = "servo", plugin(serde_macros))]
|
||||
|
||||
#![deny(unsafe_code)]
|
||||
|
|
|
@ -11,7 +11,7 @@ path = "lib.rs"
|
|||
[features]
|
||||
# servo as opposed to geckolib
|
||||
servo = ["serde", "serde_macros", "backtrace", "ipc-channel", "app_units/plugins",
|
||||
"euclid/plugins", "euclid/unstable", "url/heap_size", "url/serde"]
|
||||
"euclid/plugins", "euclid/unstable", "url/heap_size", "url/serde", "plugins"]
|
||||
|
||||
[dependencies]
|
||||
app_units = "0.2.5"
|
||||
|
@ -28,6 +28,7 @@ rustc-serialize = "0.3"
|
|||
serde = {version = "0.7.11", optional = true}
|
||||
serde_macros = {version = "0.7.11", optional = true}
|
||||
url = "1.0.0"
|
||||
plugins = {path = "../plugins", optional = true}
|
||||
|
||||
[target.'cfg(all(unix, not(target_os = "macos"), not(target_os = "ios"), not(target_os = "android")))'.dependencies]
|
||||
xdg = "2.0"
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
#![cfg_attr(feature = "servo", feature(plugin))]
|
||||
#![cfg_attr(feature = "servo", feature(reflect_marker))]
|
||||
#![cfg_attr(feature = "servo", plugin(serde_macros))]
|
||||
#![cfg_attr(feature = "servo", plugin(plugins))]
|
||||
|
||||
#![deny(unsafe_code)]
|
||||
|
||||
|
|
2
ports/cef/Cargo.lock
generated
2
ports/cef/Cargo.lock
generated
|
@ -2125,6 +2125,7 @@ dependencies = [
|
|||
"log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"matches 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"num-traits 0.1.32 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"plugins 0.0.1",
|
||||
"rand 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"rustc-serialize 0.3.19 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"selectors 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
|
@ -2333,6 +2334,7 @@ dependencies = [
|
|||
"lazy_static 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"num_cpus 0.2.13 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"plugins 0.0.1",
|
||||
"rustc-serialize 0.3.19 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"serde 0.7.11 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"serde_macros 0.7.11 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
|
|
|
@ -94,11 +94,21 @@ class MachCommands(CommandBase):
|
|||
@Command('clippy',
|
||||
description='Run Clippy',
|
||||
category='devenv')
|
||||
def clippy(self):
|
||||
features = "--features=script/plugins/clippy"
|
||||
@CommandArgument(
|
||||
'--package', '-p', default=None,
|
||||
help='Updates the selected package')
|
||||
@CommandArgument(
|
||||
'--json', '-j', action="store_true",
|
||||
help='Outputs')
|
||||
def clippy(self, package=None, json=False):
|
||||
params = ["--features=script/plugins/clippy"]
|
||||
if package:
|
||||
params += ["-p", package]
|
||||
if json:
|
||||
params += ["--", "-Zunstable-options", "--error-format", "json"]
|
||||
|
||||
with cd(path.join(self.context.topdir, "components", "servo")):
|
||||
return subprocess.call(["cargo", "build", features],
|
||||
return subprocess.call(["cargo", "rustc", "-v"] + params,
|
||||
env=self.build_env())
|
||||
|
||||
@Command('rustc',
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue