Thanks to visit codestin.com
Credit goes to github.com

Skip to content

tyeoh9/repometrics

Repository files navigation

repometrics

PyPI Python CI License

A deterministic CLI for measuring Python repository health.

pip install repository-metrics-cli
repometrics check

Quickstart

repometrics check --path /path/to/repo
repometrics check --json

scan is kept as a backward-compatible alias for check.

CLI Reference

Primary command:

repometrics check [--path DIR] [--days N] [--json] [--verbose] [--min-score N] [--confirm-test-matches] [--no-color]

Important flags:

  • --json: machine-readable output
  • --verbose: full category metrics and warnings/errors
  • --min-score: health threshold (default 70)
  • --no-color: disable ANSI colors in terminal output
  • --confirm-test-matches: interactive confirmation for ambiguous non-test_* matches

Text modes:

  • default: compact summary + small score table
  • --verbose: full stats view
  • --json: programmatic full detail

What The Points Mean

  • Structure: folder/file layout quality and balance.
  • Dependencies: import graph health (cycles, density, isolation).
  • Git: recent commit activity and contributor spread.
  • Hygiene: tests coverage mapping, TODO noise, duplication, binary footprint.
  • Final score: weighted average across available categories.

Exit Codes

  • 0: healthy (final_score >= min_score)
  • 1: unhealthy (final_score < min_score)
  • 2: runtime/validation error

Agent-Friendly Usage

  • Stable JSON payload (schema_version, category metrics, scoring, warnings/errors)
  • Additive health fields: healthy, min_score, exit_code
  • Exit codes enable CI/agent decisions without parsing human-formatted text

Minimal JSON example:

repometrics check --json --min-score 75

Development

python3 -m pytest -q

License

MIT