Repository navigation
refactor: make main pass ruff and strict pyright - #451
Merged
Merged
Conversation
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.
📚 Preview this PR's docs locallyFetch 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 451Auth & tips
|
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.
This PR brings
mainto a state whereruff check,ruff format --checkandmake type-check-strictall 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 checkreported 11 errors, andruff format --checkflagged 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.