Skip to content

docs(returns): document the report returns command and returns-group metadata - #1846

Merged
robcohen merged 2 commits into
mainfrom
docs/returns-report
Jul 22, 2026
Merged

robcohen merged 2 commits into
mainfrom
docs/returns-report

Conversation

@robcohen

Copy link
Copy Markdown
Member

What

Documents the rledger report returns command and returns-group: metadata for end users. This feature (money-weighted / XIRR and time-weighted / TWR investment returns, plus the --by-group per-group breakdown from #1841) was user-facing but had no documentation outside clap --help and the developer-facing engine crate README — it wasn't even listed in the report command page.

Changes

  • docs/commands/report.md
    • Add returns to the Subcommands table.
    • New Investment Returns section: the five flags (--investments, --income, --currency, --end, --by-group) in an options table, the money-weighted vs time-weighted distinction explained for users, a worked example with real output, the price requirement, and a Per-group breakdown subsection covering returns-group: tagging, why TOTAL is not the sum of the groups, and the stderr warnings (out-of-scope tag, prefix overlap, not-self-contained).
  • docs/reference/syntax.md
    • Document returns-group: metadata on open directives in the Metadata section, cross-linked with the command page.

Notes

  • Docs-only — no code change.
  • All example output is copied from an actual rledger report returns run (verified against the built binary), not hand-written.
  • Follows the existing per-command page convention (query.md's options-table style).

Documents #1841 (the --by-group feature) and the returns report.

🤖 Generated with Claude Code

…metadata

The `report returns` investment-returns command (money-weighted / XIRR and
time-weighted / TWR) and its `--by-group` breakdown were user-facing but
undocumented outside clap `--help` and the engine crate README.

- docs/commands/report.md: add `returns` to the subcommands table and a dedicated
  "Investment Returns" section — the five flags, the MWR-vs-TWR distinction, a
  worked example with real output, and the `--by-group` per-group breakdown
  (returns-group: tagging, the not-a-sum TOTAL, and the stderr warnings).
- docs/reference/syntax.md: document `returns-group:` metadata on `open`
  directives in the Metadata section, cross-linked with the command page.

Example output is copied from an actual `rledger report returns` run. No code
change.
Copilot AI review requested due to automatic review settings July 22, 2026 01:09
@robcohen
robcohen requested a review from a team as a code owner July 22, 2026 01:09
@codecov

codecov Bot commented Jul 22, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Documents the user-facing rledger report returns report and the returns-group: metadata used for --by-group portfolio breakdowns, bringing the CLI behavior into the main end-user docs.

Changes:

  • Adds returns to the rledger report subcommand list and documents Investment Returns, including options, example output, price requirements, and per-group breakdown behavior.
  • Documents returns-group: metadata on open directives and cross-links it to the returns report section.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
docs/commands/report.md Adds returns subcommand entry and a new “Investment Returns” section with options and grouping guidance.
docs/reference/syntax.md Adds a “returns-group metadata” subsection under Metadata with an example and link to the report docs.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread docs/commands/report.md Resolved
Comment thread docs/commands/report.md Resolved
@github-actions

Copy link
Copy Markdown
Contributor

✅ Compatibility Test Results

Metric Result
Check Compatibility 100%
BQL Compatibility 100%
Full AST Match 100%
Total Files 812
What's tested
  • Check: Exit codes and error counts match bean-check
  • BQL: Query results match bean-query
  • Files: ~800 test files downloaded from 10+ beancount repositories

Full results available in workflow artifacts

…rning list

Copilot review: a missing price at an intermediate cash-flow date degrades TWR to
n/a rather than erroring (only the --end valuation and boundary-flow conversions
error). Also list the two omitted --by-group warnings: a group named TOTAL, and
--by-group with no in-scope tags.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_013gJH7uBBF9Xw9et9QFRcsU
Copilot AI review requested due to automatic review settings July 22, 2026 01:31

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.

@robcohen
robcohen merged commit 36e5af4 into main Jul 22, 2026
52 checks passed
@robcohen
robcohen deleted the docs/returns-report branch July 22, 2026 01:56
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.

2 participants