fix(log): eliminate all direct stderr writes outside bin/qpkg and log.lua #313

Merged
fuzzy merged 2 commits from feat/no-direct-stderr into main 2026-07-09 19:57:43 +00:00
Owner

What

Eliminate all remaining io.stderr:write calls from library modules. All output now routes through log.* exclusively.

Why

Completes Phase 2 logging consolidation. Convention: only bin/qpkg (entry point) and log.lua (implementation) may use direct stderr writes.

Changes

  • cli.lua: Replace 31 io.stderr:write calls with log.status — covers help, version, list, remove, search, show, profile, activate/deactivate messages
  • All other library modules already clean from Phase 1/2 work

Testing

  • luacheck — 0 warnings, 0 errors
  • 56/56 tests pass
  • Verified: zero io.stderr:write in lib/qpkg/ outside log.lua

Breaking Changes

None — log.status preserves exact terminal output format.

Closes #240

## What Eliminate all remaining `io.stderr:write` calls from library modules. All output now routes through `log.*` exclusively. ## Why Completes Phase 2 logging consolidation. Convention: only `bin/qpkg` (entry point) and `log.lua` (implementation) may use direct stderr writes. ## Changes - `cli.lua`: Replace 31 `io.stderr:write` calls with `log.status` — covers help, version, list, remove, search, show, profile, activate/deactivate messages - All other library modules already clean from Phase 1/2 work ## Testing - [x] `luacheck` — 0 warnings, 0 errors - [x] 56/56 tests pass - [x] Verified: zero `io.stderr:write` in `lib/qpkg/` outside `log.lua` ## Breaking Changes None — `log.status` preserves exact terminal output format. Closes #240
Replace all remaining io.stderr:write calls in cli.lua with log.status,
satisfying the 'zero direct stderr writes' convention. Only exceptions:
- bin/qpkg: bootstrap error (entry point)
- lib/qpkg/log.lua: logging implementation itself

All library modules now route output through log.* exclusively.

Closes #240
docs(roadmap): mark #240 completed
All checks were successful
PR Checks / lint-and-test (pull_request) Successful in 5m21s
39067e9428
fuzzy scheduled this pull request to auto merge when all checks succeed 2026-07-09 19:52:43 +00:00
the.auditor left a comment

Review: PR #313 — Eliminate direct stderr writes outside bin/qpkg and log.lua

Verdict: Approved. Completes Phase 2 logging consolidation.

Verification

  • 31 io.stderr:writelog.status replacements in cli.lua — all counted and verified against diff. Covers help, version, list, remove, search, show, profile, activate, deactivate, and parse_args.
  • Zero io.stderr:write remaining in lib/qpkg/ outside log.lua — confirmed via grep.
  • bin/qpkg stderr write preserved — correctly allowed as entry point.
  • log.status preserves exact terminal output — same io.stderr:write(msg) + flush, plus adds log.write("status", msg) for file logging.
  • ROADMAP2.md#240 correctly marked done.

Observations

No issues found. Complete and clean mechanical refactor.

## Review: PR #313 — Eliminate direct stderr writes outside bin/qpkg and log.lua **Verdict: Approved.** Completes Phase 2 logging consolidation. ### Verification - **31 `io.stderr:write` → `log.status` replacements** in `cli.lua` — all counted and verified against diff. Covers help, version, list, remove, search, show, profile, activate, deactivate, and parse_args. - **Zero `io.stderr:write` remaining in `lib/qpkg/` outside `log.lua`** — confirmed via grep. - **`bin/qpkg` stderr write preserved** — correctly allowed as entry point. - **`log.status` preserves exact terminal output** — same `io.stderr:write(msg)` + flush, plus adds `log.write("status", msg)` for file logging. - **`ROADMAP2.md`** — #240 correctly marked done. ### Observations No issues found. Complete and clean mechanical refactor.
fuzzy merged commit 39067e9428 into main 2026-07-09 19:57:43 +00:00
fuzzy deleted branch feat/no-direct-stderr 2026-07-09 19:57:44 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
thwap/qpkg!313
No description provided.