]>
git.proxmox.com Git - rustc.git/blob - src/tools/tidy/src/main.rs
1 // Copyright 2016 The Rust Project Developers. See the COPYRIGHT
2 // file at the top-level directory of this distribution and at
3 // http://rust-lang.org/COPYRIGHT.
5 // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6 // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8 // option. This file may not be copied, modified, or distributed
9 // except according to those terms.
11 //! Tidy checks source code in this repository
13 //! This program runs all of the various tidy checks for style, cleanliness,
14 //! etc. This is run by default on `make check` and as part of the auto
23 use std
::path
::PathBuf
;
27 let path
= env
::args_os().skip(1).next().expect("need an argument");
28 let path
= PathBuf
::from(path
);
30 let args
: Vec
<String
> = env
::args().skip(1).collect();
33 let quiet
= args
.iter().any(|s
| *s
== "--quiet");
34 bins
::check(&path
, &mut bad
);
35 style
::check(&path
, &mut bad
);
36 errors
::check(&path
, &mut bad
);
37 cargo
::check(&path
, &mut bad
);
38 features
::check(&path
, &mut bad
, quiet
);
39 pal
::check(&path
, &mut bad
);
40 unstable_book
::check(&path
, &mut bad
);
41 if !args
.iter().any(|s
| *s
== "--no-vendor") {
42 deps
::check(&path
, &mut bad
);
46 eprintln
!("some tidy checks failed");