Skip to content

Experimental support for sub-classing ArgumentParser to customize add_argument #661

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

Merged
merged 3 commits into from
Jan 28, 2025

Conversation

mauvilsa
Copy link
Member

@mauvilsa mauvilsa commented Jan 22, 2025

What does this PR do?

Fixes #301 - change signature underscores to dashes
Fixes #355 - customize signature bool parameters

Before submitting

  • Did you read the contributing guideline?
  • Did you update the documentation? (readme and public docstrings)
  • Did you write unit tests such that there is 100% coverage on related code? (required for bug fixes and new features)
  • Did you verify that new and existing tests pass locally?
  • Did you make sure that all changes preserve backward compatibility?
  • Did you update the CHANGELOG? (not for typos, docs, test updates, or minor internal changes/refactors)

Copy link

codecov bot commented Jan 22, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (2285c1a) to head (e99fa1f).
Report is 1 commits behind head on main.

✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff            @@
##              main      #661   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           22        22           
  Lines         6631      6631           
=========================================
  Hits          6631      6631           

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

@mauvilsa mauvilsa added the enhancement New feature or request label Jan 27, 2025
@petergaultney
Copy link

i did some fairly rudimentary testing of my own and this seems to work. I appreciate you solving for the more general case that includes argument groups.

@mauvilsa mauvilsa merged commit eee8ea9 into main Jan 28, 2025
29 checks passed
@mauvilsa mauvilsa deleted the issues-301-355-subclass-add-argument branch January 28, 2025 07:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

CLI: can bool parameters become --flag instead of --flag true? Question: is it possible to make CLI replace parameter dashes with underscores?
2 participants