Skip to content
This repository has been archived by the owner on Nov 3, 2023. It is now read-only.

Invalid D200 errors #105

Closed
playpauseandstop opened this issue Feb 17, 2015 · 6 comments
Closed

Invalid D200 errors #105

playpauseandstop opened this issue Feb 17, 2015 · 6 comments

Comments

@playpauseandstop
Copy link

I got strange D200 errors when docstring cannot be one-liner.

For example,

    def clean(self):
        """
        Remove provider and provider hotel from form data if it not supplied.
        """

will produce D200 error.

But if change it to one-liner, like:

    def clean(self):
        """Remove provider and provider hotel from form data if it not supplied."""

the line with docstring obviously would be longer than 79 characters, so I get E501 line too long (83 > 79 characters) error.

@Nurdok
Copy link
Member

Nurdok commented Feb 17, 2015

I don't think the error is invalid. You should shorten your one line description. If you can't do it without missing since information, add a body to your docstring with details.

@Nurdok Nurdok closed this as completed Feb 28, 2015
@OddBloke
Copy link

OddBloke commented Aug 5, 2017

I don't feel particularly strongly about it, but this resolution seems wrong to me. This docstring is totally reasonable:

"""
Pretend this is super long
"""

and it's only three lines whereas the minimum possible multi-line docstring is five:

"""
Slightly shorter

Tiny amount of detail.
"""

One line would be best, but three is still better than five.

@Nurdok
Copy link
Member

Nurdok commented Aug 6, 2017

I don't agree that fewer lines is always better. A long line means a long sentence. Several lines means you've broken the first and primary description of the defintiion into a small, readable and understandable idea.

@sigmavirus24
Copy link
Member

I tend to agree with @Nurdok. I've found that this constrains me to creating a concise description and adding good detail to a body. In most cases, I'm documenting the parameters anyway, so adding a body is not a problem.

Instead of trying to force the tool to accept your style preferences, configure the tool to ignore what you don't like.

@OddBloke
Copy link

OddBloke commented Aug 9, 2017 via email

@Nurdok
Copy link
Member

Nurdok commented Aug 9, 2017

@OddBloke, no problem!

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

No branches or pull requests

4 participants