Skip to content

feat(cli): add badge subcommand for SVG score badges#32

Merged
hummbl-dev merged 1 commit into
mainfrom
feat/claude/badge
Apr 18, 2026
Merged

feat(cli): add badge subcommand for SVG score badges#32
hummbl-dev merged 1 commit into
mainfrom
feat/claude/badge

Conversation

@hummbl-dev
Copy link
Copy Markdown
Owner

Summary

  • New badge.py module with shields.io-style SVG generation
  • New badge CLI subcommand: score a repo and output an SVG badge
  • Color-coded by grade (A=green, B=yellowgreen, C=yellow, D=orange, F=red)
  • Supports --output, --markdown, --exclude, --noise-threshold
  • 13 new tests, 286 total passing

Usage

arbiter badge /path/to/repo --output badge.svg --markdown
# → Badge written to badge.svg
# → Markdown: ![Arbiter Score](badge.svg)

Test plan

  • Grade color mapping (A-F + N/A)
  • SVG structure and content
  • Score and grade in output
  • Color correctness per grade
  • XML well-formedness
  • Full suite: 286 passed

🤖 Generated with Claude Code

Generate shields.io-style flat badges showing Arbiter score and
grade. Supports --output for file, --markdown for embed snippet.
Color-coded by grade: A=green through F=red.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@hummbl-dev hummbl-dev merged commit 52a51cc into main Apr 18, 2026
3 checks passed
@hummbl-dev hummbl-dev deleted the feat/claude/badge branch April 18, 2026 17:07
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: eef27cf2a5

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/arbiter/__main__.py
loc = count_loc(repo_path)
score = score_findings(findings, loc)

svg = generate_badge(score.overall if score.is_scorable else 0, score.grade)
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Avoid reporting synthetic zero for unscorable repos

When a repository has no scorable Python LOC (score.is_scorable == False), this code forces the badge score to 0, which renders as 0 (N/A). That mixes two different states ("not scorable" vs. "scored zero") and can mislead consumers of the badge in README/automation for non-Python or fully excluded repos. The badge path should preserve an explicit non-numeric value instead of fabricating a numeric zero.

Useful? React with 👍 / 👎.

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