-
Notifications
You must be signed in to change notification settings - Fork 559
Add docstring checks to pre-commit script
#481
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
Conversation
htahir1
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cool. But if we are using this tool, we need a way to use it outside of just the pre-commit. We need it in the GitHub actions via a scripts/docstrings-check.sh or something. We can then also use that script locally without pre-commit. That means we need to add it to the pyproject.toml. So its a bit more work :-)
|
@htahir1 Yes I'll add it to the script as well. This was very much a draft PR for the moment. Our codebase has hundreds of methods that need fixing, so I'll work on this slowly on the side as it's not such a high-priority thing needing an immediate fix. |
…o misc/docstring-checks
pre-commit script
I added a
pre-commitcheck that ensures all methods contain correct docstrings as per our formatting and that arguments in the method/function signatures match what are specified in the docstring.I implemented several modules to start with as you can see in the files, but merging
developadded in a bunch more failing code so you'll see that the darglint / pydocstyle checks are only running for two modules. I will add smaller scoped PRs over the coming weeks to cover the rest.The docstring checks now run as part of the
lintscript, but I added a separatedocstring.shscript for the purpose of working on the specific task of fixing docstrings (so that you don't have to also run things likemypythat take extra time).I'll also circulate a Notion document so that the implications / decisions around this will be clear.
Pre-requisites
Please ensure you have done the following:
Types of changes