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

GL01 catches valid docstring example #574

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

stefanv
Copy link
Contributor

@stefanv stefanv commented Jul 17, 2024

def my_func():
   """Docstring on first line.

   Should be totally fine.
   """
   ...

```
def my_func():
   """Docstring on first line.

   Should be totally fine.
   """
   ...
```
@stefanv
Copy link
Contributor Author

stefanv commented Jul 17, 2024

@rossbar It seems like numpydoc validate has been catching this "error" for a long time, but in my mind it's definitely not a mistake to start the docstring on the line of the triple quotes. Looks like it was an artifact brought over from a Pandas style preference?

Will fix up the tests if we decide this is the right way forward.

@rossbar
Copy link
Contributor

rossbar commented Jul 17, 2024

This is one of those things that's totally subjective and not really useful IMO, but it's been there since validation was introduced so 🤷

@stefanv
Copy link
Contributor Author

stefanv commented Jul 17, 2024 via email

@rossbar
Copy link
Contributor

rossbar commented Jul 18, 2024

What options are available to us?

Well, it could be removed outright. Personally I'd be in favor of that - not only for this rule, but for many of the more nitty "rules" that don't actually have anything to do with numpydoc. IMO these types of things are best left to other doc linting tools (e.g. pydocstyle, though that doesn't seem to be actively supported any longer).

The non-breaking way would be to recommend users not use this rule - there are hooks for all the user APIs (pre-commit, sphinx conf, etc.) to ignore certain rules.

@stefanv
Copy link
Contributor Author

stefanv commented Jul 18, 2024

I'd be fine with removing them, or packaging them as optional nitpick rules that can be enabled (but that are disabled by default). But the job here really is to ensure that docs confirm with the numpydoc standard (and not to venture much beyond that).

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

Successfully merging this pull request may close these issues.

2 participants