Skip to content

Commit 797a7fe

Browse files
committed
Auto merge of rust-lang#10706 - Alexendoo:remove-old-generated-files-check, r=llogiq
Remove check for `lib.register_*` and `src/docs*` in `cargo dev update_lints` The transition period has well passed changelog: none
2 parents e1f6305 + 022baa5 commit 797a7fe

File tree

1 file changed

+0
-54
lines changed

1 file changed

+0
-54
lines changed

clippy_dev/src/update_lints.rs

-54
Original file line numberDiff line numberDiff line change
@@ -36,60 +36,6 @@ pub enum UpdateMode {
3636
pub fn update(update_mode: UpdateMode) {
3737
let (lints, deprecated_lints, renamed_lints) = gather_all();
3838
generate_lint_files(update_mode, &lints, &deprecated_lints, &renamed_lints);
39-
remove_old_files(update_mode);
40-
}
41-
42-
/// Remove files no longer needed after <https://github.com/rust-lang/rust-clippy/pull/9541>
43-
/// that may be reintroduced unintentionally
44-
///
45-
/// FIXME: This is a temporary measure that should be removed when there are no more PRs that
46-
/// include the stray files
47-
fn remove_old_files(update_mode: UpdateMode) {
48-
let mut failed = false;
49-
let mut remove_file = |path: &Path| match update_mode {
50-
UpdateMode::Check => {
51-
if path.exists() {
52-
failed = true;
53-
println!("unexpected file: {}", path.display());
54-
}
55-
},
56-
UpdateMode::Change => {
57-
if fs::remove_file(path).is_ok() {
58-
println!("removed file: {}", path.display());
59-
}
60-
},
61-
};
62-
63-
let files = [
64-
"clippy_lints/src/lib.register_all.rs",
65-
"clippy_lints/src/lib.register_cargo.rs",
66-
"clippy_lints/src/lib.register_complexity.rs",
67-
"clippy_lints/src/lib.register_correctness.rs",
68-
"clippy_lints/src/lib.register_internal.rs",
69-
"clippy_lints/src/lib.register_lints.rs",
70-
"clippy_lints/src/lib.register_nursery.rs",
71-
"clippy_lints/src/lib.register_pedantic.rs",
72-
"clippy_lints/src/lib.register_perf.rs",
73-
"clippy_lints/src/lib.register_restriction.rs",
74-
"clippy_lints/src/lib.register_style.rs",
75-
"clippy_lints/src/lib.register_suspicious.rs",
76-
"src/docs.rs",
77-
];
78-
79-
for file in files {
80-
remove_file(Path::new(file));
81-
}
82-
83-
if let Ok(docs_dir) = fs::read_dir("src/docs") {
84-
for doc_file in docs_dir {
85-
let path = doc_file.unwrap().path();
86-
remove_file(&path);
87-
}
88-
}
89-
90-
if failed {
91-
exit_with_failure();
92-
}
9339
}
9440

9541
fn generate_lint_files(

0 commit comments

Comments
 (0)