Repository navigation
Conversation
…-422) Add pydoclint (numpy style) as a pre-commit hook on src/, configured to check that documented parameters match the function signature (missing and stale names) and that Returns/Yields sections exist. Types, argument order and raises are not checked. Class docstrings may document __init__ parameters. Fix the drift it finds, e.g. get_extent documenting its parameters under Returns, Returns/Notes sections that did not parse, a duplicated PLACEHOLDER block in _bounding_box_mask_points, and undocumented parameters (c_coords in blobs, suppress_z_warning, sdata, zarr_path, ...). Closes scverse#1303
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1306 +/- ##
=======================================
Coverage 91.43% 91.43%
=======================================
Files 53 53
Lines 8395 8395
=======================================
Hits 7676 7676
Misses 719 719
🚀 New features to boost your workflow:
|
jan-glx
marked this pull request as ready for review
November 9, 2026 20:30
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.
Closes #1303 (SIT-422).
Adds pydoclint as a pre-commit hook on
src/, so CI catches docstrings that document parameters a function doesn't have, or miss ones it does (the #1273 / #1254 kind of drift).Config (
[tool.pydoclint]inpyproject.toml), kept narrow on purpose:__init__parameters (allow-init-docstring)kwargsmay be documented without stars, as the codebase already doesWhy pydoclint over numpydoc's
PR01/PR02validation: numpydoc also flags every docstring that has no Parameters section (~100 hits here, mostly private helpers). pydoclint only checks docstrings that do document parameters, so its findings are actual drift.Fixes for what it found (docstring-only):
get_extent: most parameters were filed under Returns, and the return value was described wrongly_bounding_box_mask_points: a leftoverPLACEHOLDERblock, and the shared min/max coordinate docs pasted in twice-------underline)c_coords(blobs),suppress_z_warning,sdata,zarr_path,intermediate_coordinate_systems, …Two kinds of intentional mismatch keep their docs, with a
# noqa:ShapesModel.parse/PointsModel.parsedocument the parameters of their singledispatch overloads, andbounding_box_query's**kwargsexists only for singledispatch (no overload accepts extra arguments), so it stays undocumented.lint.external = ["DOC1"]stops ruff's RUF100 from flagging those noqa comments as unused.