mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
Integrate clippy into Servo
This commit is contained in:
parent
3d0951cf25
commit
adfe9d249e
5 changed files with 37 additions and 1 deletions
|
@ -11,3 +11,10 @@ plugin = true
|
|||
[dependencies.tenacious]
|
||||
git = "https://github.com/servo/rust-tenacious"
|
||||
|
||||
[dependencies.clippy]
|
||||
git = "https://github.com/Manishearth/rust-clippy"
|
||||
branch = "servo"
|
||||
optional = true
|
||||
|
||||
[features]
|
||||
default = []
|
||||
|
|
|
@ -21,6 +21,8 @@ extern crate syntax;
|
|||
extern crate rustc;
|
||||
|
||||
extern crate tenacious;
|
||||
#[cfg(feature = "clippy")]
|
||||
extern crate clippy;
|
||||
|
||||
use rustc::lint::LintPassObject;
|
||||
use rustc::plugin::Registry;
|
||||
|
@ -53,10 +55,19 @@ pub fn plugin_registrar(reg: &mut Registry) {
|
|||
reg.register_lint_pass(box lints::unrooted_must_root::UnrootedPass::new() as LintPassObject);
|
||||
reg.register_lint_pass(box lints::privatize::PrivatizePass as LintPassObject);
|
||||
reg.register_lint_pass(box lints::inheritance_integrity::InheritancePass as LintPassObject);
|
||||
reg.register_lint_pass(box lints::str_to_string::StrToStringPass as LintPassObject);
|
||||
reg.register_lint_pass(box lints::ban::BanPass as LintPassObject);
|
||||
reg.register_lint_pass(box tenacious::TenaciousPass as LintPassObject);
|
||||
reg.register_attribute("must_root".to_string(), Whitelisted);
|
||||
reg.register_attribute("servo_lang".to_string(), Whitelisted);
|
||||
reg.register_attribute("allow_unrooted_interior".to_string(), Whitelisted);
|
||||
register_clippy(reg);
|
||||
}
|
||||
|
||||
#[cfg(feature = "clippy")]
|
||||
fn register_clippy(reg: &mut Registry) {
|
||||
::clippy::plugin_registrar(reg);
|
||||
}
|
||||
#[cfg(not(feature = "clippy"))]
|
||||
fn register_clippy(reg: &mut Registry) {
|
||||
reg.register_lint_pass(box lints::str_to_string::StrToStringPass as LintPassObject);
|
||||
}
|
6
components/servo/Cargo.lock
generated
6
components/servo/Cargo.lock
generated
|
@ -166,6 +166,11 @@ dependencies = [
|
|||
"winapi 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "clippy"
|
||||
version = "0.0.11"
|
||||
source = "git+https://github.com/Manishearth/rust-clippy?branch=servo#4d5e15ee6e1061ed7da0a91df3510728cabc0a21"
|
||||
|
||||
[[package]]
|
||||
name = "clock_ticks"
|
||||
version = "0.0.6"
|
||||
|
@ -1104,6 +1109,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|||
name = "plugins"
|
||||
version = "0.0.1"
|
||||
dependencies = [
|
||||
"clippy 0.0.11 (git+https://github.com/Manishearth/rust-clippy?branch=servo)",
|
||||
"tenacious 0.0.9 (git+https://github.com/servo/rust-tenacious)",
|
||||
]
|
||||
|
||||
|
|
6
ports/cef/Cargo.lock
generated
6
ports/cef/Cargo.lock
generated
|
@ -165,6 +165,11 @@ dependencies = [
|
|||
"winapi 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "clippy"
|
||||
version = "0.0.11"
|
||||
source = "git+https://github.com/Manishearth/rust-clippy?branch=servo#4d5e15ee6e1061ed7da0a91df3510728cabc0a21"
|
||||
|
||||
[[package]]
|
||||
name = "clock_ticks"
|
||||
version = "0.0.6"
|
||||
|
@ -1082,6 +1087,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|||
name = "plugins"
|
||||
version = "0.0.1"
|
||||
dependencies = [
|
||||
"clippy 0.0.11 (git+https://github.com/Manishearth/rust-clippy?branch=servo)",
|
||||
"tenacious 0.0.9 (git+https://github.com/servo/rust-tenacious)",
|
||||
]
|
||||
|
||||
|
|
6
ports/gonk/Cargo.lock
generated
6
ports/gonk/Cargo.lock
generated
|
@ -151,6 +151,11 @@ dependencies = [
|
|||
"winapi 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "clippy"
|
||||
version = "0.0.11"
|
||||
source = "git+https://github.com/Manishearth/rust-clippy?branch=servo#4d5e15ee6e1061ed7da0a91df3510728cabc0a21"
|
||||
|
||||
[[package]]
|
||||
name = "clock_ticks"
|
||||
version = "0.0.6"
|
||||
|
@ -988,6 +993,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|||
name = "plugins"
|
||||
version = "0.0.1"
|
||||
dependencies = [
|
||||
"clippy 0.0.11 (git+https://github.com/Manishearth/rust-clippy?branch=servo)",
|
||||
"tenacious 0.0.9 (git+https://github.com/servo/rust-tenacious)",
|
||||
]
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue