You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
That's valid Python and mypy is happy with it, but this project isn't, I think because the spelling of the type hint in the docstring doesn't match the spelling in the code.
$ pre-commit run --all-filesmypy.....................................................................Passedpydoclint................................................................Failed- hook id: pydoclint- exit code: 1Skipping files that match this pattern: \.git|\.toxmod.pymod.py 11: DOC105: Function `do_stuff`: Argument names match, but type hints in these args do not match: x
I'd like to be able to use RST markup (like cross-references) and more readable formats of spelling the type hint and not need to exactly match the spelling in the code.
Activity
jsh9 commentedon Apr 3, 2025
Hi @bbaabemhp , you can use the flake8 mode to ignore certain violations in a config file. This is essentially using pydoclint as a flake8 plug in.
Read more here: https://github.com/jsh9/pydoclint?tab=readme-ov-file#22-as-a-flake8-plugin
bbaabemhp commentedon Apr 3, 2025
Is there also a way for
ruff? Somehow it is not working :/jsh9 commentedon Apr 16, 2025
Hi @bbaabemhp , could you rephrase your most recent question? I don't quite understand it. Thanks!
jameslamb commentedon Sep 30, 2026
👋🏻 first time commenter... thanks for this excellent project! I just learned about it today and think it'll help a lot in projects I work on.
After a bit of time experimenting, I want to +1 this required. I'd also like to not need to involve
flake8but still skip specific rules globally.Here's a minimal example of something I'm facing:
That's valid Python and
mypyis happy with it, but this project isn't, I think because the spelling of the type hint in the docstring doesn't match the spelling in the code.I'd like to be able to use RST markup (like cross-references) and more readable formats of spelling the type hint and not need to exactly match the spelling in the code.
The spec in the
numpydocs implies that the type hint could be free-form human-readable text and doesn't need to precisely match the Python object names used to refer to types: https://numpydoc.readthedocs.io/en/latest/format.html#parametersI'd love to be able to do something like what @bbaabemhp suggested in
pyproject.toml.