feat: log progress
Some checks failed
Test / test (push) Failing after 1m25s

This commit is contained in:
Paul Campbell 2024-09-18 11:23:11 +01:00
parent 708bcb0b91
commit 37c354f8a2

View file

@ -87,6 +87,7 @@ fn scan_files(config: &Config, found_markers: &mut FoundMarkers) -> Result<()> {
}
fn scan_dir(dir: &Path, config: &Config, found_markers: &mut FoundMarkers) -> Result<()> {
println!("dir : {}", dir.to_string_lossy());
let read_dir = config.fs.dir_read(dir)?;
for entry in read_dir {
match entry? {
@ -98,14 +99,16 @@ fn scan_dir(dir: &Path, config: &Config, found_markers: &mut FoundMarkers) -> Re
Ok(())
}
fn scan_file(path: &Path, config: &Config, found_markers: &mut FoundMarkers) -> Result<()> {
fn scan_file(file: &Path, config: &Config, found_markers: &mut FoundMarkers) -> Result<()> {
println!("file: {}", file.to_string_lossy());
config
.fs
.file_read_to_string(path)?
.file_read_to_string(file)?
.lines()
.enumerate()
.filter_map(|(n, line)| prefix_match(n, line, path, config))
.filter_map(|(n, line)| prefix_match(n, line, file, config))
.for_each(|marker| {
println!("- {}", marker.line.value);
if let Some(issue) = config
.issue_pattern
.find(&marker.line.value)