Conversation
|
✅ Actions performedReview triggered.
|
|
@satococoa I've opened a new pull request, #9, to work on those changes. Once the pull request is ready, I'll request review from you. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughAdds a build-time injectable Version variable, exposes it on the CLI root command (supporting --version and -v), updates goreleaser to set the value at link time, and adds unit and integration tests plus README documentation for the flag. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ 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.
Pull request overview
This PR adds --version / -v flag support to the git-worktreeinclude CLI by wiring in urfave/cli's built-in version mechanism, injecting the release version string at build time via goreleaser ldflags, and adding documentation and test coverage for both flags.
Changes:
- Wire
Versionpackage-level variable into urfave/cli'sCommand.Versionfield, enabling built-in--versionand-voutput - Inject version at build time via goreleaser ldflags and default to
"dev"for local builds - Add unit and integration tests for version flag behavior, and document the flags in README
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
internal/cli/cli.go |
Adds var Version = "dev" global and wires it into newRootCommand()'s Version field |
internal/cli/cli_unit_test.go |
Adds TestRunRootVersion testing --version output and stdout/stderr correctness |
internal/cli/cli_integration_test.go |
Adds TestRootVersionFlags looping over --version and -v, verifying output format against the built binary |
.goreleaser.yml |
Extends ldflags to inject the release version into internal/cli.Version |
README.md |
Adds --version / -v command section under the Commands heading |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Addressed Copilot feedback in 9393d8a: TestRunRootVersion now validates both --version and -v. |
Summary
Versioninurfave/cli--version/-voutputldflagsTesting
go test ./...go run ./cmd/git-worktreeinclude --versiongo run ./cmd/git-worktreeinclude -vSummary by CodeRabbit
New Features
--versionand-v) for the CLI tool, allowing users to view the current application version.Documentation
Tests