pydocstyle icon indicating copy to clipboard operation
pydocstyle copied to clipboard

D403 does not like Camelcase words

Open ljades opened this issue 5 years ago • 5 comments

Is it by design that Pydocstyle intentionally blocks first words that are camelcase terms? For example, D403: First word of the first line should be properly capitalized ('Datastore', not 'DataStore')

In this case, the term is referring to a DataStore object, so having it recommend Datastore would be incongruent with the object name.

ljades avatar Oct 02 '19 15:10 ljades

One more example is PostgreSQL which looks completely broken when spelled like Postgresql.

andrey-semakin avatar Jul 02 '20 13:07 andrey-semakin

Isn't D403 for method/function signatures? Shouldn't the first word be imperative anyway? Datastore and PostgreSQL aren't imperative verbs.

sigmavirus24 avatar Jul 02 '20 14:07 sigmavirus24

FWIW, I hit this in a test module...

"""Reproduce https://github.com/PyCQA/pydocstyle/issues/413."""


def test_func():
    """MyCustomError mentions "foo" when str()'d."""
sscce.py:5 in public function `test_func`:
        D403: First word of the first line should be properly capitalized ('Mycustomerror', not 'MyCustomError')

Not sure how to make that imperative without making every test docstring start with "Ensure" or "Verify" :thinking:

dmtucker avatar Nov 20 '20 18:11 dmtucker

Mention "foo" when MyCustomError is str()'d.

sigmavirus24 avatar Nov 21 '20 15:11 sigmavirus24

I think that docstring is better for MyCustomError.__str__ than the test :yum:

dmtucker avatar Nov 24 '20 17:11 dmtucker