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 committed by nora
parent ecf52e2d3b
commit d023307d8d
3 changed files with 7 additions and 1 deletions

View file

@ -105,6 +105,10 @@ pub struct Options {
#[arg(skip)] #[arg(skip)]
pub no_delete_functions: bool, 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)] #[derive(Debug, Clone)]
@ -187,6 +191,7 @@ impl Default for Options {
script_path_lints: None, script_path_lints: None,
ignore_file: Vec::new(), ignore_file: Vec::new(),
no_delete_functions: false, 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 // We would hope for the unused imports pass to catch all of these
// but sadly that's not the case // 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()); self.current_path.push(tree.to_token_stream().to_string());
let should_retain = self.should_retain_item(); 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.push(regression_checker_path);
flag flag
}); });
cmd.arg("--bisect-delete-imports");
let minimize_roots = start_roots.join(","); let minimize_roots = start_roots.join(",");