Repository navigation
Conversation
generate_man_page passed ctx.command.help to inspect.cleandoc, which fails on None, so a subcommand without help raised AttributeError. Fixes click-contrib#80.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #80
generate_man_pagepassedctx.command.helpstraight toinspect.cleandoc, which fails onNone. Any command or subcommand defined without a docstring orhelp=raisedAttributeError: 'NoneType' object has no attribute 'expandtabs', as in the issue (hatch's man pages).It now uses
cleandoc(ctx.command.help or '').ManPagealready leaves out the DESCRIPTION section when the description is empty, so such a command gets a page with NAME and SYNOPSIS only.get_short_help_stralready handled a missing help text the same way.test_issue_80intests/test_issues.pybuilds aCommandwithout help, then checks that the page has a SYNOPSIS and no DESCRIPTION. It fails onmasterwith theAttributeError.pytest tests: 8 passed. ruff 0.11.4 (the pre-commit version) check and format are clean.Note: I used Claude Code while working on this.