Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minor fixes for Application.aliases #810

Merged
merged 3 commits into from
Dec 7, 2022
Merged

Conversation

azjps
Copy link
Collaborator

@azjps azjps commented Dec 7, 2022

  1. Fix the type annotations for Applications.flags / aliases, which support tuples as keys and results in linting errors (e.g. in the test suite).
  2. Move the logic for determining what to do with an unrecognized command-line argument to a helper method. Currently a warning is logged, but in past versions of traitlets an error was raised, and this might be more user-friendly in some cases especially where the stderr can be pretty verbose (e.g. launching Jupyterlab).

azjps and others added 3 commits November 24, 2022 18:48
The keys and values for Application.aliases and Application.flags
require fairly specific types (in particular the keys can be tuples
of string arguments), just writing them out. Update the corresponding
comment.
Some applications may wish to have stricter handling for unrecognized
command-line arguments in order to avoid accidental execution of a
command-line which contains typos. (It might even be the preferred
default behavior for many users.) Allow users to customize this behavior
more easily by overriding KVArgParseConfigLoader._handle_unrecognized_alias.
Copy link
Member

@blink1073 blink1073 left a comment

Choose a reason for hiding this comment

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

Thank you!

@blink1073 blink1073 merged commit 898a1bf into ipython:main Dec 7, 2022
@azjps azjps deleted the aliases2022 branch December 8, 2022 01:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants