Skip to content

fix: set Args for all cobra commands#37

Merged
feloy merged 1 commit intokortex-hub:mainfrom
feloy:cmd-args
Mar 9, 2026
Merged

fix: set Args for all cobra commands#37
feloy merged 1 commit intokortex-hub:mainfrom
feloy:cmd-args

Conversation

@feloy
Copy link
Contributor

@feloy feloy commented Mar 9, 2026

Fixes #30

Signed-off-by: Philippe Martin <phmartin@redhat.com>

Co-Authored-By: Claude Code (Claude Sonnet 4.5) <noreply@anthropic.com>
@coderabbitai
Copy link

coderabbitai bot commented Mar 9, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: bcc25902-b5fb-410c-bd88-4dec24859697

📥 Commits

Reviewing files that changed from the base of the PR and between f627344 and 26c2643.

📒 Files selected for processing (5)
  • AGENTS.md
  • pkg/cmd/list.go
  • pkg/cmd/root.go
  • pkg/cmd/workspace.go
  • pkg/cmd/workspace_list.go

📝 Walkthrough

Walkthrough

Adds argument validation to missing Cobra commands (root, workspace, and list) by setting the Args field to enforce no-argument or inherited argument constraints. Includes documentation updates in AGENTS.md defining the Args requirement and providing validation examples for command scaffolding.

Changes

Cohort / File(s) Summary
Command Argument Validation
pkg/cmd/root.go, pkg/cmd/workspace.go, pkg/cmd/workspace_list.go, pkg/cmd/list.go
Adds Args field to command definitions: root and workspace commands enforce cobra.NoArgs, workspace list command enforces cobra.NoArgs, and list command inherits args from workspaceListCmd.
Documentation
AGENTS.md
Introduces mandatory Args field requirement for Cobra command scaffolding with new "Command Argument Validation" section detailing common args options (NoArgs, ExactArgs, MinimumNArgs, MaximumNArgs, RangeArgs) and concrete examples.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

  • kortex-hub/kortex-cli#15: Refactored command constructor implementations in pkg/cmd files; this PR adds the Args validation to those constructors.
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title 'fix: set Args for all cobra commands' directly and concisely describes the main change across the entire changeset.
Description check ✅ Passed The description references issue #30, which matches the linked issue requirement to define Args for all cobra commands.
Linked Issues check ✅ Passed All objectives from issue #30 are met: Args added to list, root, and workspace commands [#30], and AGENTS.md documentation updated [#30].
Out of Scope Changes check ✅ Passed All changes are directly related to issue #30 requirements; no unrelated modifications detected in the changeset.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@feloy feloy requested review from benoitf and jeffmaury March 9, 2026 17:29
@feloy feloy merged commit 8ff7e90 into kortex-hub:main Mar 9, 2026
6 checks passed
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.

define Args for all cobra commands

2 participants