add write tool formatters#1017
Conversation
|
Warning This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
This stack of pull requests is managed by Graphite. Learn more about stacking. |
bee016d to
852ae68
Compare
852ae68 to
f2399f0
Compare
af63b1e to
1522547
Compare
f2399f0 to
4166e5d
Compare
1522547 to
2162423
Compare
mathiusj
left a comment
There was a problem hiding this comment.
write formatter — one inconsistency with the sibling formatters.
| lines = content.to_s.lines | ||
| preview = truncate(lines.first.to_s.strip) | ||
| count = lines.length | ||
| "WRITE #{path} \"#{preview}\" (+#{count} #{"line".pluralize(count)})" |
There was a problem hiding this comment.
format_write has no bare-name fallback and interpolates path untruncated — unlike every sibling. format_bash/format_ls/format_read degrade to "BASH"/"LS"/"READ" when the key is absent and run path through truncate. This line renders unconditionally, so no-args produces WRITE "" (+0 lines) (double space, empty quotes), and a long path blows the one-line goal since it isn't truncated. Suggest guarding the bare case and wrapping path in truncate to match the others.

Closes #1025