Skip to content

feat: add --body-file to lc issue create for --description - #198

Merged
ruby-automation merged 2 commits into
mainfrom
ext-21-body-file-create
Sep 3, 2026
Merged

feat: add --body-file to lc issue create for --description#198
ruby-automation merged 2 commits into
mainfrom
ext-21-body-file-create

Conversation

@ruby-automation

Copy link
Copy Markdown
Contributor

Summary

  • Adds --body-file PATH to lc issue create so descriptions can be read verbatim from a file — the same fix Phase 13 gave lc issue comment
  • --body-file - reads from stdin via IO.read(:stdio, :eof) (not IO.binread, which crashes ExUnit.CaptureIO)
  • --description and --body-file together produce a smells_bad error, no mutation sent
  • Without either option, WhatFor.description_for/1's existing interactive behaviour is unchanged

Implementation note: Rather than duplicating the three private helpers from issue_comment/1, this generalises them into validate_body_file_exclusion/3 and resolve_body_from_file/2 (parameterised on the text-field key). Both issue_comment/1 and issue_create/2 now 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, $VAR survive)
  • --body-file - reads stdin; verified that IO.read(:stdio, :eof) is used (not IO.binread) so CaptureIO works
  • --description + --body-file together → exit 22 with "give --description or --body-file, not both"
  • Unreadable --body-file path → error, no GraphQL call
  • All existing issue comment body-file tests still pass unchanged
  • mix ci green (format, credo --strict, usage_rules, tests — pre-existing GitTest permission failures excluded)

🤖 Generated with Claude Code

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>

bougyman commented Sep 3, 2026

Copy link
Copy Markdown
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.

@bougyman bougyman changed the title EXT-21: add --body-file to lc issue create for --description feat: add --body-file to lc issue create for --description Sep 3, 2026
@ruby-automation
ruby-automation merged commit 7fe4db7 into main Sep 3, 2026
3 checks passed
@ruby-automation
ruby-automation deleted the ext-21-body-file-create branch September 3, 2026 14:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants