Actually, let's not bisect imports by default

I thought it was a good idea, but now that reaper is
not completely busted, i see that this is taking a bit
longer than i'd like.. It's easier to just run reaper again
This commit is contained in:
moxian 2025-03-31 03:35:10 -07:00
parent 4af04f2191
commit 7b28f80cd6
3 changed files with 7 additions and 1 deletions

View file

@ -105,6 +105,10 @@ pub struct Options {
#[arg(skip)]
pub no_delete_functions: bool,
/// Remove individual use statements manually, instead of relying on rustc lints output
#[arg(long)]
pub bisect_delete_imports: bool,
}
#[derive(Debug, Clone)]
@ -187,6 +191,7 @@ impl Default for Options {
script_path_lints: None,
ignore_file: Vec::new(),
no_delete_functions: false,
bisect_delete_imports: false,
}
}
}

View file

@ -76,7 +76,7 @@ impl<'a> Visitor<'a> {
}
// We would hope for the unused imports pass to catch all of these
// but sadly that's not the case
Item::Use(ItemUse { tree, .. }) => {
Item::Use(ItemUse { tree, .. }) if self.checker.options.bisect_delete_imports => {
self.current_path.push(tree.to_token_stream().to_string());
let should_retain = self.should_retain_item();

View file

@ -170,6 +170,7 @@ fn build(cargo: &Path, path: &Path, regression_checker_path: &Path) -> Result<()
flag.push(regression_checker_path);
flag
});
cmd.arg("--bisect-delete-imports");
let minimize_roots = start_roots.join(",");