Skip to content

Commit

Permalink
Return to generating mod declarations in lib.rs
Browse files Browse the repository at this point in the history
  • Loading branch information
Manishearth committed Oct 6, 2021
1 parent b9dedf3 commit 0e481b9
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions clippy_dev/src/update_lints.rs
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,17 @@ pub fn run(update_mode: UpdateMode) {
)
.changed;

// This has to be in lib.rs, otherwise rustfmt doesn't work
file_change |= replace_region_in_file(
Path::new("clippy_lints/src/lib.rs"),
"begin lints modules",
"end lints modules",
false,
update_mode == UpdateMode::Change,
|| vec![gen_modules_list(usable_lints.iter())],
)
.changed;

if file_change && update_mode == UpdateMode::Check {
exit_with_failure();
}
Expand All @@ -112,11 +123,6 @@ pub fn run(update_mode: UpdateMode) {
update_mode,
&gen_deprecated(deprecated_lints.iter()),
);
process_file(
"clippy_lints/src/lib.mods.rs",
update_mode,
&gen_modules_list(usable_lints.iter()),
);

let all_group_lints = usable_lints.iter().filter(|l| {
matches!(
Expand Down

0 comments on commit 0e481b9

Please sign in to comment.