-
Notifications
You must be signed in to change notification settings - Fork 22
feat(dispatcher): constrained global arguments #220
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
base: main
Are you sure you want to change the base?
Conversation
6011c94 to
84e951b
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #220 +/- ##
==========================================
+ Coverage 93.24% 94.85% +1.61%
==========================================
Files 7 8 +1
Lines 1080 1107 +27
Branches 200 211 +11
==========================================
+ Hits 1007 1050 +43
+ Misses 66 53 -13
+ Partials 7 4 -3 ☔ View full report in Codecov by Sentry. |
84e951b to
02deb38
Compare
b5c8b5b to
499ed14
Compare
| validator=lambda mode: EmitterMode[mode.upper()], | ||
| case_sensitive=False, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
choices also exists in argparse, will validator and case_sensitive options increase the gap between global argument handling and command-specific argument handling instead of reducing it? Ideally we should have an uniform way to handle all arguments.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
validator is equivalent to argparse's type - I can rename if you'd like.
case_sensitive is different, but is there for backwards compatibility in the way we handle --verbosity, which was previously case-insensitive due to special handling. Looking over it again, I wonder if I could just run the validator before limiting choices and make a special verbosity_validator function that returns the correct emitter mode.
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Fixes #219
tox?