Skip to content

Improve usage statement conventions for positional arguments - #487

Open
brentyi wants to merge 1 commit into
mainfrom
brent/20260728_positional_usage_conventions
Open

Improve usage statement conventions for positional arguments#487
brentyi wants to merge 1 commit into
mainfrom
brent/20260728_positional_usage_conventions

Conversation

@brentyi

@brentyi brentyi commented Jul 28, 2026

Copy link
Copy Markdown
Owner

Keep positional metavars visible when the usage line is abbreviated to [OPTIONS], and add tyro.conf.PositionalMetavarFromFieldName for labeling positionals by field name, addressing #484.

Two changes:
- When the usage line is too long and gets abbreviated to [OPTIONS],
  positional metavars are now kept visible after the [OPTIONS] token
  instead of being dropped entirely.
- Add tyro.conf.PositionalMetavarFromFieldName, which labels positional
  arguments with their (uppercased) field name instead of a type-based
  metavar, following argparse conventions. Explicit metavars from
  tyro.conf.arg(metavar=...) still take precedence.
@codecov

codecov Bot commented Jul 28, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.80%. Comparing base (d0f2e3f) to head (072e2d2).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #487   +/-   ##
=======================================
  Coverage   99.79%   99.80%           
=======================================
  Files          53       53           
  Lines        4495     4507   +12     
=======================================
+ Hits         4486     4498   +12     
  Misses          9        9           
Flag Coverage Δ
unittests 99.80% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

brentyi commented Jul 29, 2026

Copy link
Copy Markdown
Owner Author

Status: all pytest and pyright jobs are green. The ruff, mypy, and ty failures are pre-existing on main: CI runs unpinned latest linters, and all flagged locations are in files this PR does not touch (verified locally that unmodified main fails ruff 0.16.0 with the same 18 PLR0917 errors; mypy and ty failures are similar version drift in test_bug_repros.py and test_unsupported_but_should_work.py). Will re-check once the base is green.


Generated by Claude Code

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