sphinx-argparse icon indicating copy to clipboard operation
sphinx-argparse copied to clipboard

Special formatting of ranges as choices instead of listing entries

Open jonrebm opened this issue 6 months ago • 1 comments

We're using an argument with choices=range(0, 256). This leads to a long list of all the options in the generated documentation. This patch reduces code duplication by moving choice formatting to a separate function invoked for action groups, positional arguments, and optional arguments. The only functional change is that for objects of type range with a step of one, formatting is changed from "Possible choices: 0, 1, 2 [...]" to "Value range: 0 to 256"

jonrebm avatar Jul 28 '25 18:07 jonrebm

Codecov Report

:x: Patch coverage is 42.85714% with 4 lines in your changes missing coverage. Please review. :warning: Please upload report for BASE (main@2a2a202). Learn more about missing BASE report.

Files with missing lines Patch % Lines
sphinxarg/ext.py 42.85% 3 Missing and 1 partial :warning:
Additional details and impacted files
@@           Coverage Diff           @@
##             main      #69   +/-   ##
=======================================
  Coverage        ?   46.97%           
=======================================
  Files           ?       12           
  Lines           ?      960           
  Branches        ?      205           
=======================================
  Hits            ?      451           
  Misses          ?      468           
  Partials        ?       41           
Flag Coverage Δ
unittests 46.97% <42.85%> (?)

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

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

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

codecov[bot] avatar Jul 28 '25 18:07 codecov[bot]