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

DOCS: Enable subset of pydocstyle rules, bulk update ruff fixes #3550

Merged
merged 21 commits into from Mar 8, 2024

Conversation

connortann
Copy link
Collaborator

@connortann connortann commented Mar 7, 2024

Overview

Fixes a large number of pydocstyle linting rules.

This should help us avoid the Sphinx formatting issues that we've encountered quite a few times, with automated fixes on pre-commit.

Changes

  • Adds a number of pydocstyle to our ruff config
  • Defines the convention as "numpy"-style, to match the existing style
  • Fixes about 14 rules, mostly the ones which have automatic fixes available

Reviewing

This PR is both simple and complex. It's simple as it comprises only automated fixes to docstrings, but it's complex as the diff is very large.

Whilst this is initially rather tiresome to fix & review, I think that have automated ruff rules with autofixes will help the code maintenance be simpler & easier in future.

For ease of review, I have fixed one rule per commit. I would suggest reviewing the commits individually: the majority are very simple whitespace changes that can be skim-read.

Most commits were made automatically with a single command like ruff check . select=D411 --fix.

Note to self: this branch builds upon #3549, so that should be reviewed/merged first. Once this PR is squashed & merged, we could include the commit hash in .git-blame-ignore-revs.

@connortann connortann added the documentation Relating to readthedocs, notebooks, and exposition in docstrings label Mar 7, 2024
@connortann connortann changed the title Enable subset of pydocstyle rules DOCS: Enable subset of pydocstyle rules Mar 7, 2024
@connortann connortann marked this pull request as ready for review March 7, 2024 11:11
@connortann connortann changed the title DOCS: Enable subset of pydocstyle rules DOCS: Enable subset of pydocstyle rules, bulk update ruff fixes Mar 7, 2024
@connortann connortann deleted the branch master March 8, 2024 10:17
@connortann connortann closed this Mar 8, 2024
@connortann connortann reopened this Mar 8, 2024
@connortann connortann changed the base branch from docs to master March 8, 2024 10:20
Copy link
Collaborator

@CloseChoice CloseChoice left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good to me. I just had one question that arose from going through the commits in the wrong order but figured that out quickly.

Thanks for the great work and an extra thanks for thinking about the reviewer when doing that work. That really helped A LOT.

@connortann connortann merged commit 56394f1 into master Mar 8, 2024
16 checks passed
@connortann connortann deleted the pydocstyle branch March 8, 2024 11:08
@connortann
Copy link
Collaborator Author

As a follow-up thought, please do feel free to tweak the rules and per-file-ignores in pyproject.toml, if you feel anything should be changed. For example, I realised we can just ignore the pydocstyle rules in ./tests, as it has no real benefit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Relating to readthedocs, notebooks, and exposition in docstrings
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants