-
Notifications
You must be signed in to change notification settings - Fork 4
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
Issue #78: Formatted docstrings to better utilize sphinx-apidoc #94
Conversation
I like the changes that package made; looks like the only place it made black angry is an empty docstring, which probably shouldn't be there. Any rationale for https://github.com/DanielNoord/pydocstringformatter as opposed to the seemingly more popular https://github.com/PyCQA/docformatter ? Haven't used either before, just curious. I do think we should add it as a commit check, whichever way we go. |
No real reason, pydocstringformatter was the first package that I came across. |
3cf03e0
to
1692bc2
Compare
I looked into it a bit more and realized that ruff can be used for docstring linting, which is great because there is no need to add another github action. I added some rules for ruff to follow in the .ruff.toml, but they are a bit strict. Should I relax them a bit? |
160890c
to
0d213a3
Compare
0d213a3
to
3a5e371
Compare
What are some examples of it possibly being too strict? |
For one, it requires a docstring for every function. The ideal case for using this is if it would complain only on new code that doesn't have docstrings in new functions, but I'm not sure that ruff would work like that. If you look at the details of the commit check, ruff finds 100+ functions without docstrings, which I think (?) it might highlight on every commit. |
Yeah, I think we can have it ignore D101 and D102; the rest of it's complaints seem reasonable which what I can tell, though hard to see if it's flagging anything else weird in the sea of missing doctoring warnings. |
oop, I missed that D103 is also one of those, can ignore that as well. How many of the remaining issues can ruff fix automatically? |
Looking more into it I think ruff will only warn on errors, not actually fix them. I can look more into alternative solutions. |
Description
Closes #XXX
Please include a summary of the changes and the related issue. Please also include relevant motivation and context. List any dependencies that are required for this change.
How should this pull request be reviewed?
Type of change
How Has This Been Tested?
Please describe the tests that you ran to verify your changes.
pytest --cov bsk_rl/envs/general_satellite_tasking --cov-report term-missing tests/unittest
pytest --cov bsk_rl/envs/general_satellite_tasking --cov-report term-missing tests/integration
Test Configuration
Checklist:
One check is unusually failing.
Issue #XXX: Message
and have a useful messageThis PR focuses on just formatting existing docstrings to be used by sphinx-apidoc in auto-generated documentation. I used the python package
pydocstringformatter
to perform these changes. There is no change in code.When I was looking into this problem, I found a number of tools that can be used as commit checks like Black or Ruff to check docstring format (as i think the two linters do not support this at the moment). Should I go ahead and do that in this PR?