Skip to content

Extend API doc auto-linker for class bases, re-exports, and module labels#1880

Closed
Copilot wants to merge 3 commits into
mainfrom
copilot/fix-pre-commit-macos-latest
Closed

Extend API doc auto-linker for class bases, re-exports, and module labels#1880
Copilot wants to merge 3 commits into
mainfrom
copilot/fix-pre-commit-macos-latest

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Jun 1, 2026

This stacks on the docstring auto-linker work and closes remaining link gaps in generated API pages. It makes class inheritance and re-export entries linkable when symbols resolve in the index, while preserving plain code spans for external/unresolvable symbols.

  • Class Bases: line now participates in symbol linking

    • render_class now formats bases via a dedicated _format_bases() path.
    • Each base is rendered independently and passed through _rewrite_symbol_refs, so internal PyRIT bases become MyST links and external bases stay plain.
  • ## Re-exports now links alias and target consistently

    • Added _format_reexport_alias():
      • first tries module-qualified lookup ({module}.{alias}) so aliases resolve to their own page anchor when available;
      • falls back to short-name rewriting when no module-qualified entry exists.
    • Added _format_reexport_target() to route targets through _rewrite_symbol_refs, linking resolvable FQNs and leaving external paths unchanged.
  • Module frontmatter now includes a stable page label

    • render_module now emits label: api-<module_slug> alongside short_title, enabling page-level cross-reference targets.
  • Unit coverage expanded for new link behavior

    • Added targeted tests for:
      • mixed internal/external base rendering,
      • re-export alias preferred module-qualified resolution,
      • re-export alias fallback behavior,
      • module frontmatter label emission.
# Before
Bases: `PromptTarget`

# After
Bases: [`PromptTarget`](#api-pyrit_prompt_target-PromptTarget)

Copilot AI changed the title [WIP] Fix failing GitHub Actions job pre-commit (macos-latest) Fix macOS pre-commit failure by removing forbidden reST role markup in docstrings Jun 1, 2026
Copilot AI requested a review from ValbuenaVC June 1, 2026 21:00
@romanlutz
Copy link
Copy Markdown
Contributor

@ValbuenaVC this seems related to #1824

@ValbuenaVC ValbuenaVC changed the title Fix macOS pre-commit failure by removing forbidden reST role markup in docstrings FIX: macOS pre-commit failure by removing forbidden reST role markup in docstrings Jun 1, 2026
Copilot AI changed the title FIX: macOS pre-commit failure by removing forbidden reST role markup in docstrings Extend API doc auto-linker for class bases, re-exports, and module labels Jun 1, 2026
@ValbuenaVC ValbuenaVC closed this Jun 1, 2026
@romanlutz romanlutz deleted the copilot/fix-pre-commit-macos-latest branch June 1, 2026 22:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants