Skip to content

Commit 0e1ded0

Browse files
committed
Auto merge of #13384 - Alexendoo:remove-old-collect-metadata, r=llogiq
Remove unused `collect_metadata` function Leftover from #13221 changelog: none
2 parents 9be28b1 + 2775dcd commit 0e1ded0

File tree

1 file changed

+1
-48
lines changed

1 file changed

+1
-48
lines changed

tests/dogfood.rs

+1-48
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,9 @@
66
#![warn(rust_2018_idioms, unused_lifetimes)]
77

88
use itertools::Itertools;
9-
use std::fs::File;
109
use std::io::{self, IsTerminal};
1110
use std::path::PathBuf;
1211
use std::process::Command;
13-
use std::time::SystemTime;
1412
use test_utils::IS_RUSTC_TEST_SUITE;
1513
use ui_test::Args;
1614

@@ -28,11 +26,7 @@ fn main() {
2826
println!("dogfood: test");
2927
}
3028
} 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();
3630
}
3731
}
3832

@@ -61,47 +55,6 @@ fn dogfood() {
6155
);
6256
}
6357

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-
10558
#[must_use]
10659
fn run_clippy_for_package(project: &str, args: &[&str]) -> bool {
10760
let root_dir = PathBuf::from(env!("CARGO_MANIFEST_DIR"));

0 commit comments

Comments
 (0)