check -q hides which files failed #195

Open
opened 2026-10-12 11:17:37 +02:00 by clawbot · 0 comments
Collaborator

mfer check -q prints nothing about a missing, corrupted or wrongly-moded file, nor about an extra file under --no-extra-files; only exit status 1 says the check failed. countCheckFailures and findExtraFiles in internal/cli/check.go log each failure with log.Infof, and -q sets the level to errors only (setVerbosity in internal/cli/mfer.go). The -q help says Suppress output except errors, the README says check displays an error for a bad file, and #103 settled that --quiet suppresses the warnings, not the failures.

Reproduce on next (0fbb3da): mfer gen t; echo corrupt > t/a.txt; mfer check -q t exits 1 and prints nothing.

Correct: each failed file (MISSING, SIZE_MISMATCH, HASH_MISMATCH, MODE_MISMATCH, ERROR, and EXTRA under --no-extra-files) is logged at error level, so -q still shows it; EXTRA without --no-extra-files stays a warning. The closing N failed summary may stay at info level.

Definition of done

  • Failing test first through the CLI: check -q on a corrupted file prints the HASH_MISMATCH line; check -q on a passing tree prints nothing.
  • The fix in internal/cli/check.go.
  • make check passes.

Model: fable-5-1

`mfer check -q` prints nothing about a missing, corrupted or wrongly-moded file, nor about an extra file under `--no-extra-files`; only exit status 1 says the check failed. `countCheckFailures` and `findExtraFiles` in `internal/cli/check.go` log each failure with `log.Infof`, and `-q` sets the level to errors only (`setVerbosity` in `internal/cli/mfer.go`). The `-q` help says `Suppress output except errors`, the README says `check` displays an error for a bad file, and https://git.eeqj.de/sneak/mfer/issues/103 settled that `--quiet` suppresses the warnings, not the failures. Reproduce on `next` (0fbb3da): `mfer gen t; echo corrupt > t/a.txt; mfer check -q t` exits 1 and prints nothing. Correct: each failed file (`MISSING`, `SIZE_MISMATCH`, `HASH_MISMATCH`, `MODE_MISMATCH`, `ERROR`, and `EXTRA` under `--no-extra-files`) is logged at error level, so `-q` still shows it; `EXTRA` without `--no-extra-files` stays a warning. The closing `N failed` summary may stay at info level. ## Definition of done - Failing test first through the CLI: `check -q` on a corrupted file prints the `HASH_MISMATCH` line; `check -q` on a passing tree prints nothing. - The fix in `internal/cli/check.go`. - `make check` passes. Model: fable-5-1
clawbot self-assigned this 2026-10-12 11:17:37 +02:00
Sign in to join this conversation.