Skip to content

Name the full path of a file that fails to hash [patch] - #167

Merged
matt-edmondson merged 1 commit into
mainfrom
fix/hash-error-full-path
Oct 6, 2026
Merged

matt-edmondson merged 1 commit into
mainfrom
fix/hash-error-full-path

Conversation

@matt-edmondson

Copy link
Copy Markdown
Contributor

Fixes #154

What changed

FileHasher.ReportSkipped printed Error hashing {filePath.FileName}. In a tree where IMG_0001.jpg or index.js appears many times, that doesn't tell you which copy failed. It now prints the absolute path, as every other diagnostic in the tool already does.

Tests

I added VerbOutputTests.AHashingErrorNamesTheFullPath. It puts IMG_0001.jpg in two folders, holds one of them open with FileShare.None (the same technique StatsReportsAFileItCannotHashAsUnreadable uses, so it also works under root), and asserts that the output contains Error hashing <full path>:.

The issue suggested asserting this in FileScannerAndHasherTests.HashingSkipsAnUnreadableFileAndStillHashesTheRest instead. That class is not [DoNotParallelize], and redirecting the console there would race other tests. VerbOutputTests already redirects the console safely, so the test lives there.

With the FileHasher.cs change reverted, the new test fails. With it, the full suite passes: 60 passed, 2 pre-existing skips.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Q5ZFyLG9PgeKn5RpzhWEUQ


Generated by Claude Code

FileHasher.ReportSkipped printed only the file name, so in a tree where
IMG_0001.jpg or index.js repeats there was no way to tell which copy
could not be read. It now prints the absolute path, like every other
diagnostic the tool writes.

Fixes #154

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Q5ZFyLG9PgeKn5RpzhWEUQ
@sonarqubecloud

sonarqubecloud Bot commented Oct 6, 2026

Copy link
Copy Markdown

@matt-edmondson
matt-edmondson merged commit 655edd6 into main Oct 6, 2026
14 checks passed
@matt-edmondson
matt-edmondson deleted the fix/hash-error-full-path branch October 6, 2026 12:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

"Error hashing" messages show only the file name, so the failing file can't be found in a tree with repeated names

2 participants