Preview gp-sphinx#36 curated default-value rendering#668
Open
tony wants to merge 1 commit into
Open
Conversation
b14ff20 to
fdb4a8a
Compare
eaa2021 to
61a9ee5
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #668 +/- ##
=======================================
Coverage 51.29% 51.29%
=======================================
Files 25 25
Lines 3488 3488
Branches 686 686
=======================================
Hits 1789 1789
Misses 1404 1404
Partials 295 295 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
b5c6cdf to
bff95f5
Compare
why: `DEFAULT_OPTION_SCOPE` is the sentinel default for the `scope=` parameter on every option-related helper (Pane._show_option, Server.show_options, Window._set_options_raw, …). Without a docstring on the assignment Sphinx's autodoc skips it under `automodule :members: undoc-members:`, so the docs site has no `#libtmux.constants.DEFAULT_OPTION_SCOPE` anchor — and any default- value cross-reference in those signatures has no target to link to. Adding the attribute docstring (PEP 258 — module-attribute docstring picked up by `ModuleAnalyzer.attr_docs`) gives the sentinel a docs entry and lets the gp-sphinx default-value xref transform render `scope=DEFAULT_OPTION_SCOPE` as a clickable link to the documented constant on `api/libtmux.constants/`. Also promote `_DefaultOptionScope`'s `# Sentinel value for default scope` comment to a proper docstring; the class already shows up as a documented entry on the constants page (per the autodoc default options) and a real docstring describes the sentinel pattern more clearly than the stub comment. what: - Add an attribute docstring to `DEFAULT_OPTION_SCOPE` describing the sentinel semantics and the per-receiver scope inference rule. - Replace `_DefaultOptionScope`'s stub comment with a class docstring describing the sentinel-type role and pointing at the lone documented instance.
367114a to
898b0a9
Compare
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.
Summary
[tool.uv.sources]so the docs build picks up the changes before a release bump propagates them via PyPI.Pane._show_option(scope=<libtmux.constants._DefaultOptionScope object>, …)now render asPane._show_option(scope=DEFAULT_OPTION_SCOPE, …)withDEFAULT_OPTION_SCOPElinked to the documented constant in the same<a class="reference internal"><code class="xref py py-class">…</code></a>HTML shape that inline:py:class:roles produce. Hook dataclass__init__defaults stop showing=<factory>and instead render=[],={},=set(), etc.[DO NOT MERGE]commit that adds the branch to.github/workflows/docs.yml'son.push.brancheslist so the live docs site previews the branch. Revert that commit before merging.After gp-sphinx>=0.0.1a18 ships, replace this with a normal version bump (
0.0.1a17→0.0.1a18across the four pinned gp-sphinx-family packages) and revert both commits in this branch.Test plan
uv lockresolves all gp-sphinx-family workspace siblings to commit8c3a1418on the branchuv sync --all-extras --devclean install from git sourcescd docs && just htmluv run python ../gp-sphinx/packages/sphinx-autodoc-typehints-gp/scripts/audit_defaults.py libtmux=docs/_build/htmlPane._show_option,Pane._show_hook, hook dataclass__init__signaturesdocsworkflow runs against this branch (enabled by the[DO NOT MERGE]commit) and publishes to the docs site for live preview