Repository navigation
refactor: one Table/JSON output module for the list commands - #43
Merged
Merged
Conversation
frantufro
force-pushed
the
refactor/output-module
branch
from
November 13, 2026 13:01
b15d18f to
5213589
Compare
TaskDoc parses and renders frontmatter, the H1 title and the body. core/frontmatter.rs moves into core/task_doc.rs, the H1 rule and read_body are shared by both new commands, and list reads metadata through TaskDoc. File output is unchanged.
Both list commands now build rows of cells and call commands::output, which owns column widths, padding and JSON escaping (via serde_json).
frantufro
force-pushed
the
refactor/output-module
branch
from
November 13, 2026 13:19
5213589 to
4d88e28
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
src/commands/output.rs:render/printtake aFormat(Table or Json), headers and rows ofCell(Text, Number, Null). It owns column widths (char count), padding (last column unpadded), the-/nullrendering of missing values and JSON escaping viaserde_json.commands/list.rsandcommands/roadmap/list.rsnow only map their rows to cells. Both copies ofrender_table,write_row,render_jsonandpush_json_stringare deleted.tests/list.rsandtests/roadmap.rspass untouched.add-one-table-json-output-modulemoved to done.Escaping check
serde_json matches the old hand-written escaper on quotes, backslash, \n, \r, \t, \b, \f, other control chars (lowercase
\u00xx, e.g.\u0001,\u001f) and non-ASCII (emitted raw). The unit testjson_escapes_quotes_backslash_and_controlscovers these. No difference found. DEL (0x7f) is emitted raw by both.Verification
cargo fmtcargo clippy --all-targets -- -D warnings -W clippy::pedantic(local default toolchain, not the pinned 1.98.0)cargo test --locked