Skip to content

refactor: make main pass ruff and strict pyright - #451

Merged
has2k1 merged 3 commits into
mainfrom
refactor/static-gates
Oct 27, 2026
Merged

has2k1 merged 3 commits into
mainfrom
refactor/static-gates

Conversation

@has2k1

@has2k1 has2k1 commented Oct 27, 2026

Copy link
Copy Markdown
Collaborator

This PR brings main to a state where ruff check, ruff format --check and make type-check-strict all pass, so that CI can enforce them. Strict pyright reported 110 errors in the module that shares long reference sidebars between pages, although that module is on the strict include list. ruff check reported 11 errors, and ruff format --check flagged 11 files.

Most changes are type-only or formatting. Two unreachable fallbacks go: the "griffe not available" branch of docstring-style detection and an unused probe in skill discovery. Every site gets a copy of the colour-swatch shortcode, whose single-letter variables are renamed, so that file differs in every build while the pages it renders do not.

Strict pyright reported 110 errors in the shared reference sidebar module,
and `make type-check-strict` failed on main.

Type parsed YAML values so runtime checks can narrow their types, and
explicitly discard unused results. Behaviour is unchanged.
`ruff check` reported 11 errors on main.

- Import the Pillow image, Click command and versioned-build badge expiry
  types for type checking. String annotations referred to them without
  imports.
- Remove the unused griffe import and its unreachable fallback from
  docstring-style detection. Griffe is a required dependency, and detection
  loads packages through the build's cache.
- Remove the unused package-distribution lookup from skill discovery.
  Every supported Python version provides it.
- Replace single-letter names in the build progress bar and colour-swatch
  shortcode with descriptive names.
- Merge the accent-colour test's expected-content lists for the same page.
  The second list silently replaced the first and was a subset of it.

Every site gets a copy of the colour-swatch shortcode, so that copy changes
in every build. The pages it renders do not change.
`ruff format --check` flagged 11 files on main. Apply the required
formatting.

ruff 0.17 also formats Python blocks in Markdown. Add the missing blank
line between two functions in a docstring style example so the check
passes under both ruff 0.15 and ruff 0.17.
@has2k1
has2k1 added this pull request to stack #455 October 27, 2026 20:37
@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 40579556112

# or always the latest build for this PR
great-docs preview --pr 451
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 3f8d0ff into main Oct 27, 2026
8 checks passed
@has2k1
has2k1 deleted the refactor/static-gates branch October 27, 2026 21:52
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