From 56b95f9ca4c6ae9059d95c8bd64baa0dc51e9527 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Linus=20F=C3=A4rnstrand?= Date: Fri, 30 Aug 2024 13:39:41 +0200 Subject: [PATCH] Read user config for every file we want to scan --- src/main.rs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/main.rs b/src/main.rs index 8fbbf8a..dca313d 100644 --- a/src/main.rs +++ b/src/main.rs @@ -125,12 +125,14 @@ fn main() -> anyhow::Result<()> { }; for path in args.paths { - dispatcher.user_config = get_user_config(&path)?; - for entry in walkdir::WalkDir::new(path) { match entry { Err(err) => eprintln!("{:}", err), - Ok(entry) if entry.file_type().is_file() => check_file(&dispatcher, entry.path()), + Ok(entry) if entry.file_type().is_file() => { + let entry_path = entry.path(); + dispatcher.user_config = get_user_config(entry_path)?; + check_file(&dispatcher, entry_path); + } Ok(_) => {} } }