Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade Ruff configuration for v0.2.0 #11927

Merged
merged 2 commits into from Feb 2, 2024
Merged

Upgrade Ruff configuration for v0.2.0 #11927

merged 2 commits into from Feb 2, 2024

Conversation

charliermarsh
Copy link
Contributor

Summary

Hopefully a welcome PR, but this upgrades Sphinx's Ruff configuration to reflect some of the changes we're making in v0.2.0. We use Sphinx in our ecosystem checks, and I wanted to do an example migration anyway, both for illustrative purposes and for my own testing. (This PR won't pass until we do the actual v0.2.0 release.)

Here's a summary of the relevant changes for Sphinx:

  • show-source = true was replaced by output-format = "full". (This is a deprecation, not a removal, so changing it here merely removes the deprecation warning.)
  • Rules ANN101 and ANN102 were deprecated. (Selecting them with preview enabled is now an error; selecting them outside of preview is a warning.)
  • PGH001 was redirected to S307 (I enabled S307 and changed the # NoQA assertions, which would've continued to work, but with a deprecation warning).
  • RUF011 was redirected to B035 (which you already have enabled, so I just removed RUF011, which would've warned).
  • TCH006 was redirected to TCH010 to match the upstream plugin.

@charliermarsh
Copy link
Contributor Author

For completeness, these are the warnings that would've been raised:

warning: The `show-source` option has been deprecated in favor of `output-format`'s "full" and "concise" variants. Please update your configuration to use `output-format = <full|concise>` instead.
warning: `RUF011` has been remapped to `B035`.
warning: `TCH006` has been remapped to `TCH010`.
ruff failed
  Cause: Selection of deprecated rule `ANN102` is not allowed when preview is enabled.

@AA-Turner AA-Turner marked this pull request as ready for review February 2, 2024 00:06
@AA-Turner
Copy link
Member

Thanks Charlie!

@AA-Turner AA-Turner merged commit aff9578 into sphinx-doc:master Feb 2, 2024
21 checks passed
@charliermarsh charliermarsh deleted the charlie/ruff branch February 2, 2024 00:15
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 21, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants