8000 Split generation of help extra items and rendering by kdeldycke · Pull Request #2517 · pallets/click · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Split generation of help extra items and rendering #2517

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 2 commits into from
Nov 2, 2024
Merged

Split generation of help extra items and rendering #2517

merged 2 commits into from
Nov 2, 2024

Conversation

kdeldycke
Copy link
Collaborator
@kdeldycke kdeldycke commented May 16, 2023

This:

This is a small refactor of the original Option.get_help_record() method, splitting it in two to separate the generation of extra items in help screen and their rendering.

This PR:

  • extracts from get_help_record() the code responsible for extra items generation, and move it to its own get_help_extra() method
  • leaves the original get_help_record() as-is, but rely on the new get_help_extra() method to fetch the extra items to render for the help
  • makes the new get_help_extra() returns a dictionary of extra items to be rendered, so get_help_record() can pick them up to render (and translate) them the way it wants
  • augments the original get_help_record() unittests to inspect values returned by get_help_extra()

Checklist:

  • Add tests that demonstrate the correct behavior of the change. Tests should fail without the change.
  • Add or update relevant docs, in the docs folder and in code.
  • Add an entry in CHANGES.rst summarizing the change and linking to the issue.
  • Add .. versionchanged:: entries in any relevant code docs.
  • Run pre-commit hooks and fix any issues.
  • Run pytest and tox, no tests failed.

@kdeldycke
Copy link
Collaborator Author

All tests are passing, typing has been fixed and unit-tests have been added. This PR is ready to be merged upstream.

@davidism davidism added this to the 8.2.0 milestone Jul 4, 2023
@kdeldycke
Copy link
Collaborator Author

Thanks @davidism for considering this PR for merging to 8.2.0! I just rebased it following the recent 8.1.4 and it is ready to be reviewed and merged.

@kdeldycke
Copy link
Collaborator Author

This PR has been rebased on the latest main branch and all test are passing.

This PR is ready to merged for Click 8.2.0.

@AndreasBackx AndreasBackx mentioned this pull request Oct 20, 2024
34 tasks
kdeldycke and others added 2 commits November 2, 2024 23:14
[pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

Update changelog
@AndreasBackx AndreasBackx merged commit 948d7a7 into pallets:main Nov 2, 2024
12 checks passed
@kdeldycke kdeldycke deleted the split-help-extra-generation branch November 3, 2024 04:58
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 20, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Split extra help item computing with help record rendering
3 participants
0