The first word in a docstring should be capitalized #164

Closed
Nurdok opened this Issue Dec 8, 2015 · 4 comments

Projects

None yet

2 participants

@Nurdok
Member
Nurdok commented Dec 8, 2015

This docstring

def foo():
    """return x."""

Should return an error in this style:

D4xx: First sentence of a docstring should be capitalized ("Return", not "return")

I haven't found a section in the original PEP that refers to capitalization, but all of the examples in the PEP are correctly capitalized. I'm wondering whether this new error should be checked by default. My instinct says that "a phrase ending in a period" (from the PEP) is a proper sentence, which should be capitalized, but I'm not sure if the PEP mandates it.

Does anyone have any thought regarding this?

@Nurdok Nurdok self-assigned this Dec 8, 2015
@sigmavirus24
Member

So PEP 8 authors are typically happy to clarify their intentions. You can implement this while you wait for a response from the PEP 257 authors and then put it in the default ignore list if you'd like.

@Nurdok
Member
Nurdok commented Dec 8, 2015

I sent them a query and will start working on this. Thanks for the suggestion.

@sigmavirus24
Member

🍰

@Nurdok
Member
Nurdok commented Dec 13, 2015

Implemented in #165

@Nurdok Nurdok closed this Dec 13, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment