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

Standard docstrings style for the codebase #1060

Open
pedro-psb opened this issue Feb 25, 2024 · 3 comments
Open

Standard docstrings style for the codebase #1060

pedro-psb opened this issue Feb 25, 2024 · 3 comments

Comments

@pedro-psb
Copy link
Member

Problem

Some parts of the codebase use Sphinx-style docstrings and others use Google's, and there is not a clear definition about this. Also, with the addition of auto-generated docs (#1058) , the docs render doesn't come out very pretty.

See here examples of these (and other) different styles.

Proposal

  • Define Google Style as the default style
  • Change all docstrings to the new format
  • Use some linter/formatter to enforce this with out pre-commit setup. (e.g. https://pypi.org/project/docformatter/)

Alternatives

We could use another style as well (if there is a strong opinion towards that). I would only argue that using a linter/auto-formatter should help get the codebase sharp.

@mitches-got-glitches
Copy link
Contributor

Hey @pedro-psb , I wanted to get your thoughts on using ruff for docstring standardisation instead of docformatter? ruff could be brought in for this use case, but eventually it could be swapped in as a replacement for flake8, black and import sorter too.

@rochacbruno
Copy link
Member

+1 for google style

@pedro-psb
Copy link
Member Author

I didn't know ruff did that, I'm ok with giving it a try.
Wdyt @rochacbruno ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants