refactor: enable linting of docs/custom_conf.py#1330
Merged
james-garner-canonical merged 3 commits intocanonical:mainfrom Aug 23, 2024
Merged
refactor: enable linting of docs/custom_conf.py#1330james-garner-canonical merged 3 commits intocanonical:mainfrom
james-garner-canonical merged 3 commits intocanonical:mainfrom
Conversation
It's not worth importing the type because this file is largely not type hinted anyway.
Changes should be made in docs/custom_conf.py where possible. Enable custom_rst_epilog in docs/custom_conf.py (set to an empty string) in lieu of removing rst_epilog from docs/conf.py (this commit restores rst_epilog to docs/conf.py). Remove global ruff: noqa directive for docs/conf.py -- ruff linting for this file is already disabled in pyproject.toml
Re-enable linting for docs/custom_conf.py (removing global noqa), but selectively disable tests that fail, as much of this code is based on sphinx-docs-starter-pack/custom_conf.py, which does not use the same linting as this project.
benhoyt
approved these changes
Aug 22, 2024
Collaborator
benhoyt
left a comment
There was a problem hiding this comment.
Thanks -- I was a bit on the fence about just ignoring all these warnings, but I think each of them seems reasonable to me in the context of custom_conf.py.
Contributor
Author
|
I agree that it's not ideal to disable so many warnings. Hopefully at least having the other linting checks enabled for the file will be helpful in future. |
dimaqq
approved these changes
Aug 23, 2024
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 reverts the only edit to docs/conf.py, which was made in this commit, and enables linting of docs/custom_conf.py
The resulting linting errors have been resolved primarily via
tool.ruff.lint.per-file-ignores, with one inline noqa (copyrightvariable shadows builtin), and the removal of a type annotation not in scope (Node). It didn't seem worth spending significant time to add docstrings and resolve the other errors at this point. In fact, I'm not entirely sure whether it's worth merging in these changes, as it sounds like we've yet to settle on how the docs code will be handled with respect to upstream going forward, but I figured I might as well make a PR for review anyway in case it's helpful.