feat: add --body-file to lc issue create for --description - #198
Merged
Conversation
Mirrors Phase 13's `lc issue comment --body-file` pattern: - `--body-file PATH` reads the description verbatim from a file - `--body-file -` reads from stdin via IO.read(:stdio, :eof) - `--description` and `--body-file` together produce a smells_bad error Generalises `validate_comment_options/1` and `resolve_comment_body/1` into `validate_body_file_exclusion/3` and `resolve_body_from_file/2` so both issue comment and issue create share the same body-file logic. Closes EXT-21. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Member
|
PR Titles must also follow conventional commit messages. We have been skipping releases because our PR Titles are being used as the merge/squash commit and release-please ignores it. Stop that. |
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
--body-file PATHtolc issue createso descriptions can be read verbatim from a file — the same fix Phase 13 gavelc issue comment--body-file -reads from stdin viaIO.read(:stdio, :eof)(notIO.binread, which crashesExUnit.CaptureIO)--descriptionand--body-filetogether produce asmells_baderror, no mutation sentWhatFor.description_for/1's existing interactive behaviour is unchangedImplementation note: Rather than duplicating the three private helpers from
issue_comment/1, this generalises them intovalidate_body_file_exclusion/3andresolve_body_from_file/2(parameterised on the text-field key). Bothissue_comment/1andissue_create/2now share the same path.Closes EXT-21 (https://linear.app/the-rubyists/issue/EXT-21)
Test plan
--body-file <path>creates issue with description matching file contents exactly (literal\n,$VARsurvive)--body-file -reads stdin; verified thatIO.read(:stdio, :eof)is used (notIO.binread) soCaptureIOworks--description+--body-filetogether → exit 22 with "give --description or --body-file, not both"--body-filepath → error, no GraphQL callissue commentbody-file tests still pass unchangedmix cigreen (format, credo --strict, usage_rules, tests — pre-existing GitTest permission failures excluded)🤖 Generated with Claude Code