Show complete help text for dagshub repo create - #716
Show complete help text for dagshub repo create#716Muhtasim-Munif-Fahim wants to merge 2 commits into
Conversation
`dagshub repo --help` derived the command listing from the first line of the
`create` docstring, which is "create a repo and optionally:". The listing
therefore ended on a dangling colon and read as truncated output:
Commands:
create create a repo and optionally:
Giving the command an explicit `short_help` makes the listing a complete
sentence.
The long help was mangled too. The bullet list and the examples are
pre-formatted, but nothing marked them as such, so click rewrapped them into
run-on paragraphs and collapsed the indentation:
- upload files to 'data' from a URL dir using `-u` flag. .zip and .tar files
are extracted, other formats copied as is.
Adding click's `\b` no-rewrap markers keeps the structure intact.
Adds tests/common/test_cli.py, the first CLI test in the suite, asserting the
listing carries a complete summary and that the bullets and examples survive
rendering. Both fail without this change.
Fixes DagsHub#310
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (2)
📝 WalkthroughWalkthroughThe ChangesRepository command help
Estimated code review effort: 2 (Simple) | ~10 minutes Merge Risk: ⚪ Minimal · up to This PR improves the repository creation command’s summary and formatted help output without changing repository behavior; no actionable merge-blocking risk remains beyond normal checks and review. Poem
🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🧹 Nitpick comments (1)
tests/common/test_cli.py (1)
12-21: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winAssert the rendered structure explicitly.
The tests check individual text fragments and example labels. They do not check the command row, leading spaces, the
.zipcontinuation line, or the complete example commands. A later rewrap can therefore pass these tests while breaking the behavior this PR targets. Assert the full preformatted blocks with their newlines and indentation.Also applies to: 24-36
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 7c44abaa-eab2-42bd-932e-6f810fbb3237
📒 Files selected for processing (2)
dagshub/common/cli.pytests/common/test_cli.py
📜 Review details
🔇 Additional comments (2)
dagshub/common/cli.py (1)
330-330: LGTM!tests/common/test_cli.py (1)
1-9: LGTM!
Two points from review.
The `-u` description said "from a URL dir", which I carried over from the
original text. It is wrong: `upload_data` is passed straight to
`http_request("GET", upload_data)` and the downloaded name comes from
`os.path.basename(urlparse(upload_data).path)`. That is a single file, and both
examples use one. "dir" invites passing a directory listing URL, which does
not work.
The tests checked that fragments appeared somewhere in the output, which a
later rewrap could satisfy while breaking the layout the escapes exist to
protect. They now assert whole lines, including indentation and the complete
example command, so a regression in the formatting fails rather than passes.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
|
Both addressed in 7c55979. "URL dir" — you're right, and I'd carried that wording over from the original rather than checking it. Structural assertions — also fair. Substring checks would have passed on a rewrap that broke the very layout the |
Fixes #310.
The listing
click builds a command listing entry from the first line of the docstring. For
createthat line iscreate a repo and optionally:, so the listing ends on a dangling colon and reads exactly as #310 reports — as if the output were cut off:An explicit
short_helpon the command makes it a complete sentence:The long help
While reproducing this I found
dagshub repo create --helpis mangled too. The bullet list and the examples are pre-formatted, but nothing told click so, and it rewrapped them:Note the lost indentation on the continuation line and the collapsed run of spaces in example 2. Adding click's
\bno-rewrap markers keeps the structure:I treated that as part of the same complaint since it is the same help output, but happy to split it out if you would rather keep the PR to the listing alone.
Tests
Adds
tests/common/test_cli.py— as far as I can tell the first CLI test in the suite — usingclick.testing.CliRunnerto assert the listing carries a complete summary and that the bullets and examples survive rendering. Both fail without this change.tests/commonplustests/test_misc.pyis 50 passed.tests/common/test_determine_repo.pyfails to collect on my machine for want ofpytest_git, which is unrelated and reproduces on a clean checkout.Verified against click 8.4.2.
🤖 Generated with Claude Code