Skip to content

refactor: inline GreatDocs methods that only forward a call - #467

Merged
has2k1 merged 2 commits into
mainfrom
refactor/inline-pass-throughs
Oct 29, 2026
Merged

has2k1 merged 2 commits into
mainfrom
refactor/inline-pass-throughs

Conversation

@has2k1

@has2k1 has2k1 commented Oct 29, 2026

Copy link
Copy Markdown
Collaborator

This PR removes six private GreatDocs methods whose only job was to forward to another call, such as reading the package root from the layout or escaping HTML. Each added a name to core.py that readers had to look up only to find a one-line delegation, and tests patched them as if they did more: twelve package-root patches never changed their tests' outcome.

It also removes function-level imports that repeat a module-level import, among them eight copies of import subprocess. Builds produce the same output.

Remove six private GreatDocs methods whose only job was forwarding:
read the package root from the resolved layout, detect Go CLI projects,
detect Rust CLI projects, place one skill in well-known directories,
generate MCP reference pages and escape HTML. Call the existing operations
directly.

Remove tests whose only subject was forwarding. The HTML-escaping tests
checked the standard library; the package-root tests repeated tests of
layout resolution, and the Go and Rust detection tests repeated tests of
the detection functions.

Remove twelve package-root patches from logo, favicon and hero tests.
Each test already resolves the package root to its temporary directory,
so these patches did not affect outcomes.

Behaviour and build output are unchanged.
Use the module-level names for `json`, `os`, `re`, `shutil`, `subprocess`,
`sys`, `datetime` and `read_yaml`. Remove the repeated function-level
imports, including seven private aliases, and update their uses.

Two aliased imports inside the Quarto configuration update stay as they
are.

Behaviour and build output are unchanged.
@github-actions

Copy link
Copy Markdown

📚 Preview this PR's docs locally

Fetch the just-built site and open it in your browser:

# this exact build
great-docs preview --run 40878441983

# or always the latest build for this PR
great-docs preview --pr 467
Auth & tips
  • Requires great-docs: pip install great-docs (or run via pipx/uvx).
  • Auth: run gh auth login then add --use-gh, or set GITHUB_TOKEN (needs Actions: read).
  • Jump to a page: add --path reference/index.html.
  • Latest vs exact: --pr <n> grabs the newest build; --run <id> pins this one.
  • Re-download: --refresh ignores the local cache.

@has2k1
has2k1 merged commit 72ea5e5 into main Oct 29, 2026
9 checks passed
@has2k1
has2k1 deleted the refactor/inline-pass-throughs branch October 29, 2026 13:26
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.

1 participant