mirror of
https://github.com/rust-lang/rust-clippy
synced 2025-02-17 06:28:42 +00:00
also run clippy on examples
This commit is contained in:
parent
6daa884e4f
commit
6d7269a675
1 changed files with 7 additions and 0 deletions
|
@ -143,13 +143,20 @@ pub fn main() {
|
||||||
let args = std::env::args().skip(2);
|
let args = std::env::args().skip(2);
|
||||||
if let Some(first) = target.kind.get(0) {
|
if let Some(first) = target.kind.get(0) {
|
||||||
if target.kind.len() > 1 || first.ends_with("lib") {
|
if target.kind.len() > 1 || first.ends_with("lib") {
|
||||||
|
println!("compiling library");
|
||||||
if let Err(code) = process(std::iter::once("--lib".to_owned()).chain(args), &dep_path, &sys_root) {
|
if let Err(code) = process(std::iter::once("--lib".to_owned()).chain(args), &dep_path, &sys_root) {
|
||||||
std::process::exit(code);
|
std::process::exit(code);
|
||||||
}
|
}
|
||||||
} else if first == "bin" {
|
} else if first == "bin" {
|
||||||
|
println!("compiling bin target `{}`", target.name);
|
||||||
if let Err(code) = process(vec!["--bin".to_owned(), target.name].into_iter().chain(args), &dep_path, &sys_root) {
|
if let Err(code) = process(vec!["--bin".to_owned(), target.name].into_iter().chain(args), &dep_path, &sys_root) {
|
||||||
std::process::exit(code);
|
std::process::exit(code);
|
||||||
}
|
}
|
||||||
|
} else if first == "example" {
|
||||||
|
println!("compiling example target `{}`", target.name);
|
||||||
|
if let Err(code) = process(vec!["--example".to_owned(), target.name].into_iter().chain(args), &dep_path, &sys_root) {
|
||||||
|
std::process::exit(code);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
panic!("badly formatted cargo metadata: target::kind is an empty array");
|
panic!("badly formatted cargo metadata: target::kind is an empty array");
|
||||||
|
|
Loading…
Add table
Reference in a new issue