Skip to content

Say how many files Validate checked, including none - #138

Merged
amrali-eg merged 1 commit into
masterfrom
fix/validate-status-counts
Sep 28, 2026
Merged

amrali-eg merged 1 commit into
masterfrom
fix/validate-status-counts

Conversation

@amrali-eg

Copy link
Copy Markdown
Owner

Problem

In the GUI, files that pass Validate are not added to the list, and the status was built from the row count. It read "0 files do not have the correct encoding" both when every file passed and when a mistyped mask matched nothing, so a clean result could stand in for a check that never ran. Found in the 2026-09-20 review (F3), from the source.

Change

  • A small ValidationTally counts every file the scan reports, from the scan's worker threads (Interlocked), including files that pass and so get no row.
  • The Validate status now reads one of:
    • No matching files were examined
    • Checked N files: all valid
    • Checked N files: X do not have the correct encoding, plus , Y could not be read when the scan could not open some files.
  • Exclusion coverage (files skipped by name or rule) is still appended as before. View and cancelled statuses are unchanged.
  • Backlog entry BL-40.

Tests

ValidationStatusTests feeds real Validate scans into the same tally the window uses:

  • a mask that matches nothing, and an empty folder: "No matching files were examined";
  • two valid files: "Checked 2 files: all valid";
  • valid + windows-1252 + a file held open with FileShare.None: "Checked 3 files: 1 do not have the correct encoding, 1 could not be read";
  • valid + windows-1252: the familiar wording with the total.

Mutation checks (each restored byte-for-byte afterwards)

Mutation Tests failing
No "nothing examined" message 2
Unreadable counted as invalid 1
Valid files not counted as examined 3

Limits

  • The two lines that connect the tally to the window (count in the scan callback, describe on completion) are checked by reading, not by a test.
  • The GUI smoke suite does not run Validate. Its scan-finished check matches "files processed", which View still writes, so it is unaffected.

Verification

🤖 Generated with Claude Code

Files that pass validation get no row, and the status came from the row
count, so it read "0 files do not have the correct encoding" both when
every file passed and when a mistyped mask matched nothing.

The window now counts every file the scan reports. The status reads "No
matching files were examined", "Checked N files: all valid", or "Checked N
files: X do not have the correct encoding", adding "Y could not be read"
for files the scan could not open. Exclusion coverage is still appended.

Tests feed real Validate scans into the same count: no match, an empty
folder, all valid, and a mix with a file held open. Three counting
mutations fail them. The form wiring is two lines checked by reading; the
GUI smoke suite does not run Validate.

Backlog: BL-40.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@amrali-eg
amrali-eg merged commit 1aeb5d8 into master Sep 28, 2026
3 checks passed
@amrali-eg
amrali-eg deleted the fix/validate-status-counts branch September 28, 2026 21:11
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.

1 participant