Skip to content

Commit

Permalink
Add support for click 8.1.x
Browse files Browse the repository at this point in the history
click 8.1.0 changed the behavior of the various stored help strings:

  Store unprocessed Command.help, epilog and short_help strings.
  Processing is only done when formatting help text for output.

[1] https://click.palletsprojects.com/en/8.1.x/changes/#version-8-1-0

Signed-off-by: Stephen Finucane <[email protected]>
  • Loading branch information
stephenfin committed Apr 7, 2022
1 parent 431f159 commit efef056
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
3 changes: 2 additions & 1 deletion sphinx_click/ext.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import inspect
import re
import traceback
import warnings
Expand Down Expand Up @@ -101,7 +102,7 @@ def _write_opts(opts):


def _format_help(help_string):
help_string = ANSI_ESC_SEQ_RE.sub('', help_string)
help_string = inspect.cleandoc(ANSI_ESC_SEQ_RE.sub('', help_string))

bar_enabled = False
for line in statemachine.string2lines(
Expand Down
1 change: 0 additions & 1 deletion tests/test_formatter.py
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,6 @@ def foobar():
foobar [OPTIONS]
An epilog containing pre-wrapped text.
| This is
Expand Down

0 comments on commit efef056

Please sign in to comment.