Skip to content

Bug (v2): wily report with no metrics shows zero metric columns #263

@tonybaloney

Description

@tonybaloney

Summary

Running wily report <file> with no metric arguments prints a table containing only Revision, Author, Date — no metric columns at all. The docs state: "By default, wily will show all available metrics."

Environment

  • wily 2.0.0a2 (v2 / master @ cd768bb), backend 2.0.0-alpha.2
  • Python 3.12, Windows 11 ARM64
  • Test repo: microsoft/graphrag

Steps to reproduce

> wily --path <graphrag> report packages/graphrag/graphrag/index/utils/derive_from_rows.py

Actual

┌──────────┬───────────────┬────────────┐
│ Revision │ Author        │ Date       │
├──────────┼───────────────┼────────────┤
│ 5fd2dd7  │ Anthony Shaw  │ 2026-05-17 │
│ 6f26d0e  │ Dayenne Souza │ 2026-02-27 │
└──────────┴───────────────┴────────────┘

Passing metrics explicitly works fine:

> wily ... report .../derive_from_rows.py raw.loc cyclomatic.complexity   # shows metric columns

Expected

With no metrics specified, wily report shows all available metrics (per the docs).

Root cause

The metrics argument is declared with nargs=-1 in src/wily/__main__.py, so when omitted Click passes an empty tuple (), not None. But src/wily/commands/report.py only falls back to ALL_METRICS when metrics is None:

if metrics is None:
    resolved_metrics = ALL_METRICS
else:
    metrics = sorted(set(metrics))   # () -> []
    resolved_metrics = [...]          # [] -> no metric columns

So the empty tuple takes the else branch and yields zero metrics.

Suggested fix

Treat an empty collection the same as None, e.g. if not metrics: resolved_metrics = ALL_METRICS. (Note: once fixed, default report will display all ~20 metric columns; consider a sensible default subset or wide-table handling — see the related wily diff wide-table issue.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions