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

Invalid D200 errors #105

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

Comments

Projects
None yet
4 participants
@playpauseandstop
Copy link

commented Feb 17, 2015

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

This comment has been minimized.

Copy link
Member

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 Feb 28, 2015

@OddBloke

This comment has been minimized.

Copy link

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

This comment has been minimized.

Copy link
Member

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

This comment has been minimized.

Copy link
Member

commented Aug 6, 2017

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

This comment has been minimized.

Copy link

commented Aug 9, 2017

@Nurdok

This comment has been minimized.

Copy link
Member

commented Aug 9, 2017

@OddBloke, no problem!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.