Skip to content

refactor(cli): deduplicate boosted card level flag#86

Merged
klauern merged 1 commit intomainfrom
chore/refactor-boosted-card-flag
Apr 28, 2026
Merged

refactor(cli): deduplicate boosted card level flag#86
klauern merged 1 commit intomainfrom
chore/refactor-boosted-card-flag

Conversation

@klauern
Copy link
Copy Markdown
Owner

@klauern klauern commented Apr 28, 2026

Summary

  • extract a shared boostedCardLevelFlag helper and constants
  • replace three duplicated --boosted-card-level flag declarations
  • use a shared flag name constant in runtime reads
  • add test coverage for helper contract

Validation

  • GOCACHE=/tmp/go-build go test ./cmd/cr-api -run 'BoostedCardLevel|UnlockedEvolutions|DeckBuild|AnalyzeSuite'

Notes

  • Additional duplication/refactor opportunities were identified in command flag definitions and output format declarations and should be tracked in beads once bd bootstrap is repaired.

Summary by CodeRabbit

  • Chores

    • Centralized command-line flag configuration across multiple commands.
  • Tests

    • Added test coverage for flag definitions.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 28, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: b0071a33-4d98-4c82-b45a-26a29bb69cd3

📥 Commits

Reviewing files that changed from the base of the PR and between 0121e61 and 77fcb3d.

📒 Files selected for processing (5)
  • cmd/cr-api/boosted_levels.go
  • cmd/cr-api/boosted_levels_test.go
  • cmd/cr-api/deck_analyze_suite_runtime.go
  • cmd/cr-api/deck_build_commands.go
  • cmd/cr-api/deck_build_runtime.go

📝 Walkthrough

Walkthrough

The pull request centralizes the CLI flag definition for --boosted-card-level by introducing a reusable helper function and constant, replacing hard-coded flag name strings across multiple command files with references to the shared definition.

Changes

Cohort / File(s) Summary
Flag Definition & Tests
cmd/cr-api/boosted_levels.go, cmd/cr-api/boosted_levels_test.go
Introduces boostedCardLevelFlag() helper function and boostedCardLevelFlagName constant; includes unit test validating flag name and usage text properties.
Flag Usage Updates
cmd/cr-api/deck_build_commands.go, cmd/cr-api/deck_build_runtime.go, cmd/cr-api/deck_analyze_suite_runtime.go
Replaces hard-coded flag name string "boosted-card-level" with boostedCardLevelFlagName constant and inline flag definitions with boostedCardLevelFlag() helper function calls.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐰 A flag once scattered, now made whole,
One constant guards the boosted soul,
No more strings repeated thrice,
Refactored clean—a rabbit's delight! ✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 16.67% 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
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately and specifically describes the main change: deduplicating the boosted card level flag by extracting a shared helper and centralizing constants.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

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

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch chore/refactor-boosted-card-flag

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.

@klauern klauern merged commit 69f94dc into main Apr 28, 2026
9 checks passed
@klauern klauern deleted the chore/refactor-boosted-card-flag branch April 28, 2026 15:01
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.

1 participant