Skip to content

Show help for aliases to unregistered configurables - #1002

Open
vibhor-aggr wants to merge 2 commits into
ipython:mainfrom
vibhor-aggr:fix/unregistered-alias-help
Open

vibhor-aggr wants to merge 2 commits into
ipython:mainfrom
vibhor-aggr:fix/unregistered-alias-help

Conversation

@vibhor-aggr

Copy link
Copy Markdown

Problem

CLI aliases can target a Configurable outside Application.classes and successfully populate its configuration. Generating --help for the same application raises KeyError when it tries to look up that class's trait metadata.

Change

When the target class is not registered, render the alias with a generic value placeholder, its optional help text, and the full equivalent config option. Keep the existing typed help for registered classes.

Regression tests exercise real CLI parsing and help output, short and long aliases, custom descriptions, and nested config targets.

Fixes #499.

🤖🤖 Automated contribution (Codex).

🤖🤖 Automated contribution (Codex).
@codecov

codecov Bot commented Dec 1, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.27%. Comparing base (a576f24) to head (a5ee6b0).

Components Coverage Δ
traitlets 85.75% <100.00%> (+0.12%) ⬆️
tests 99.07% <100.00%> (+<0.01%) ⬆️

☔ 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.

🤖🤖 Automated contribution (Codex).
@vibhor-aggr

Copy link
Copy Markdown
Author

Fixed the two application.py mypy errors in a5ee6b0. The current lint job now reports only the four unused ignores in argcomplete_config.py that also failed on the exact base commit. #1001 already removes those ignores, so I’ve kept that cleanup out of this alias-help change.

This branch has not been deployed

No deployments
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.

Application.print_alias_help() should take into account *any* Configurable class

1 participant