Skip to content

refactor: delete code in the core builder that never ran - #446

Merged
has2k1 merged 2 commits into
mainfrom
refactor/dead-code
Oct 27, 2026
Merged

has2k1 merged 2 commits into
mainfrom
refactor/dead-code

Conversation

@has2k1

@has2k1 has2k1 commented Oct 27, 2026

Copy link
Copy Markdown
Collaborator

This PR removes code from the core builder that never ran in a build or never changed its output. Freeze preparation called four methods that do not exist, each inside a handler that swallowed the error, and snapshot auto-save had a branch for non-versioned builds that could not be reached. Other pieces had outlived their callers: a tag-slug helper, a reference-index front-matter updater that ran before the page existed, the copy of a renderer asset that no longer ships, a fallback for Python versions below the supported minimum, and three keys of the API categories that nothing read.

The multi-version guide also promised an API snapshot after every successful build. It now says after every successful versioned build, which is what Great Docs does.

Remove code that never ran in a real build, or never changed a build's
output:

- four freeze-preparation calls to methods that do not exist, each
  inside a handler that swallowed the resulting error;
- an unused tag-slug helper;
- the reference-index front-matter updater, which returned at once
  because the page is written later, and whose two keys the API
  reference writer already sets;
- the copy of a renderer asset that no longer ships;
- the resource-loading fallback for Python versions below the
  supported minimum;
- the snapshot auto-save for non-versioned builds, which was
  unreachable. Auto-save stays for versioned builds.

Also remove three keys of the API categories that nothing read (member
types and the class and function unions), along with the code that
computed only them: sub-classifying methods and the loop over
`ClassName.method` references. A `ClassName.method` reference still
puts its class under `classes`, and a new test covers that.

The tests of the removed code go too. Behaviour is unchanged: the
characterisation harness matches `main` on all cases.
The multi-version guide said a snapshot is saved after every
successful build. Only versioned builds save one.
@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 40541919913

# or always the latest build for this PR
great-docs preview --pr 446
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 c69c5d0 into main Oct 27, 2026
8 checks passed
@has2k1
has2k1 deleted the refactor/dead-code branch October 27, 2026 16:47
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