Skip to content

fix: finalize structured output only on success; docs facelift + em-dash normalize - #17

Merged
TMHSDigital merged 1 commit into
mainfrom
chore/cosmetic-0.6.1
Jun 4, 2026
Merged

TMHSDigital merged 1 commit into
mainfrom
chore/cosmetic-0.6.1

Conversation

@TMHSDigital

Copy link
Copy Markdown
Owner

Part A cosmetic patch (logged under CHANGELOG [Unreleased]).

Code:

  • main.go: out.Finish() moved off defer to just before the success return 0, so an early error (e.g. wildcard without -force) no longer emits an empty JSON array in -format json. Text mode unchanged; file flush/close defer still runs after Finish.
  • output: new test documenting structured output is emitted only by Finish.

Docs:

  • docs/index.md refreshed to the 0.6.0 feature set (-format, -rate, -type, -recursive/-depth) matching the README Feature Matrix.
  • Normalized em dashes to hyphens across docs/. Arrows and code identifiers intact.

Made with Cursor

…ash normalize

Code:
- main.go: move out.Finish() off defer to just before the success "return 0".
  Previously the deferred finalizer ran on every exit path, so an early error
  (e.g. wildcard detection without -force) emitted an empty JSON array in
  -format json. Text mode is unchanged (Finish is a no-op for text). The file
  flush/close defer still runs after Finish, so buffered JSON/CSV is persisted
  before the file closes.
- internal/output: add TestWriterJSONFinishGatesOutput documenting that
  structured output is emitted only by Finish (no Finish = no spurious array).

Docs:
- docs/index.md: refreshed to the 0.6.0 feature set with cards for Output
  Formats (-format), Rate Limiting (-rate), Record Types (-type), and Recursive
  Enumeration (-recursive/-depth), matching the README Feature Matrix.
- Normalized em dashes to hyphens across docs/ (index, ARCHITECTURE,
  DEVELOPER_GUIDE, _config.yml, default.html). Arrows and code identifiers
  left intact; changelog history untouched.

Logged under CHANGELOG [Unreleased].

Co-authored-by: Cursor <cursoragent@cursor.com>
@TMHSDigital
TMHSDigital merged commit 8df599e into main Jun 4, 2026
6 checks passed
@TMHSDigital
TMHSDigital deleted the chore/cosmetic-0.6.1 branch June 4, 2026 02:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

1 participant