diff --git a/src/commands/scan.rs b/src/commands/scan.rs index 2b7bfe76..03ec00b4 100644 --- a/src/commands/scan.rs +++ b/src/commands/scan.rs @@ -31,9 +31,6 @@ pub fn handle( ) -> Result<(), Box> { let scan_path = Path::new(path).canonicalize()?; let (project_name, db_path) = get_project_info(&scan_path, database_dir)?; - - let mut indexer = Indexer::new(&project_name, &db_path)?; - let diags: Vec; if no_index { @@ -43,6 +40,8 @@ pub fn handle( tracing::debug!("Scanning filesystem index filesystem"); crate::commands::index::build_index(&project_name,&scan_path, &db_path, config)?; } + + let mut indexer = Indexer::new(&project_name, &db_path)?; diags = scan_with_index(&project_name, &db_path, config, &mut indexer)?; } @@ -95,6 +94,8 @@ fn scan_with_index( let mut issues: Vec = Vec::new(); for path in paths { if indexer.should_scan(&path)? { + tracing::debug!("scanning files{}", path.display()); + let mut diags = run_rules_on_file(&path, cfg)?; let file_id = indexer.upsert_file(&path)?; diff --git a/src/walk.rs b/src/walk.rs index b55fe72e..fd35e66b 100644 --- a/src/walk.rs +++ b/src/walk.rs @@ -8,6 +8,7 @@ const BATCH_SIZE: usize = 5; type Batch = Vec; +#[derive(Debug)] struct Batcher { tx: crossbeam_channel::Sender, batch: Batch, @@ -82,6 +83,7 @@ pub fn spawn_senders( match entry { Ok(e) if e.file_type().is_some_and(|ft| ft.is_file()) => { b.push(e.into_path()); + tracing::debug!("scanning file: {:?}", b); if batch.len() == BATCH_SIZE { let _ = tx.send(std::mem::take(&mut batch)); }