6
6
#![ warn( rust_2018_idioms, unused_lifetimes) ]
7
7
8
8
use itertools:: Itertools ;
9
- use std:: fs:: File ;
10
9
use std:: io:: { self , IsTerminal } ;
11
10
use std:: path:: PathBuf ;
12
11
use std:: process:: Command ;
13
- use std:: time:: SystemTime ;
14
12
use test_utils:: IS_RUSTC_TEST_SUITE ;
15
13
use ui_test:: Args ;
16
14
@@ -28,11 +26,7 @@ fn main() {
28
26
println ! ( "dogfood: test" ) ;
29
27
}
30
28
} else if !args. skip . iter ( ) . any ( |arg| arg == "dogfood" ) {
31
- if args. filters . iter ( ) . any ( |arg| arg == "collect_metadata" ) {
32
- collect_metadata ( ) ;
33
- } else {
34
- dogfood ( ) ;
35
- }
29
+ dogfood ( ) ;
36
30
}
37
31
}
38
32
@@ -61,47 +55,6 @@ fn dogfood() {
61
55
) ;
62
56
}
63
57
64
- fn collect_metadata ( ) {
65
- assert ! ( cfg!( feature = "internal" ) ) ;
66
-
67
- // Setup for validation
68
- let metadata_output_path = PathBuf :: from ( env ! ( "CARGO_MANIFEST_DIR" ) ) . join ( "util/gh-pages/lints.json" ) ;
69
- let start_time = SystemTime :: now ( ) ;
70
-
71
- // Run collection as is
72
- std:: env:: set_var ( "ENABLE_METADATA_COLLECTION" , "1" ) ;
73
- assert ! ( run_clippy_for_package(
74
- "clippy_lints" ,
75
- & [ "-A" , "unfulfilled_lint_expectations" ]
76
- ) ) ;
77
-
78
- // Check if cargo caching got in the way
79
- if let Ok ( file) = File :: open ( metadata_output_path) {
80
- if let Ok ( metadata) = file. metadata ( ) {
81
- if let Ok ( last_modification) = metadata. modified ( ) {
82
- if last_modification > start_time {
83
- // The output file has been modified. Most likely by a hungry
84
- // metadata collection monster. So We'll return.
85
- return ;
86
- }
87
- }
88
- }
89
- }
90
-
91
- // Force cargo to invalidate the caches
92
- filetime:: set_file_mtime (
93
- PathBuf :: from ( env ! ( "CARGO_MANIFEST_DIR" ) ) . join ( "clippy_lints/src/lib.rs" ) ,
94
- filetime:: FileTime :: now ( ) ,
95
- )
96
- . unwrap ( ) ;
97
-
98
- // Running the collection again
99
- assert ! ( run_clippy_for_package(
100
- "clippy_lints" ,
101
- & [ "-A" , "unfulfilled_lint_expectations" ]
102
- ) ) ;
103
- }
104
-
105
58
#[ must_use]
106
59
fn run_clippy_for_package ( project : & str , args : & [ & str ] ) -> bool {
107
60
let root_dir = PathBuf :: from ( env ! ( "CARGO_MANIFEST_DIR" ) ) ;
0 commit comments