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

Are D203 and D211 in conflict? #141

Closed
jacebrowning opened this Issue Oct 9, 2015 · 7 comments

Comments

Projects
None yet
2 participants
@jacebrowning
Copy link
Contributor

jacebrowning commented Oct 9, 2015

From http://pep257.readthedocs.org/en/latest/error_codes.html:

D203: 1 blank line required before class docstring

D211: No blank lines allowed before class docstring

It seems impossible to satisfy both as this fails D211:

class Class:

    """A sample class."""

and this fails D203:

class Class:
    """A sample class."""

What am I missing?

@jacebrowning

This comment has been minimized.

Copy link
Contributor Author

jacebrowning commented Oct 9, 2015

I tend to just disable D203 in my projects.

@Nurdok

This comment has been minimized.

Copy link
Member

Nurdok commented Oct 9, 2015

Yes, they are in conflict. D203 should be disabled by default. See #91.

@jacebrowning

This comment has been minimized.

Copy link
Contributor Author

jacebrowning commented Oct 9, 2015

Its seems to be enabled in 0.7.0:

$ cat demo/sample.py
"""A sample module."""


class Class(object):
    """A sample class."""

$ pep257 --version
0.7.0

$ pep257 demo
demo/sample.py:4 in public class `Class`:
        D203: 1 blank line required before class docstring (found 0)

@Nurdok

This comment has been minimized.

Copy link
Member

Nurdok commented Oct 9, 2015

Do you have a configuration file with an ignore option in the same or ancestor directory? I just checked 0.7.0 in a virtualenv and it behaves as expected.

@jacebrowning

This comment has been minimized.

Copy link
Contributor Author

jacebrowning commented Oct 9, 2015

Yes:

[pep257]

ignore = D202

Is the presence of an ignore option going to enable normally disabled rules?

@Nurdok

This comment has been minimized.

Copy link
Member

Nurdok commented Oct 9, 2015

Yes. If you want to add your ignore to the list instead of overriding it, use add-ignore in the config file (or --add-ignore in the command line).

@jacebrowning

This comment has been minimized.

Copy link
Contributor Author

jacebrowning commented Oct 9, 2015

Thanks!

szhu added a commit to szhu/SublimeLinter-contrib-cjsx that referenced this issue Dec 28, 2015

Update .travis.yml for pep257
D203 and D211 are in conflict in new pep257
PyCQA/pydocstyle#141

tgecho added a commit to tgecho/SublimeLinter-contrib-elm-make that referenced this issue Mar 2, 2016

tgecho added a commit to tgecho/SublimeLinter-contrib-elm-make that referenced this issue Mar 2, 2016

@0mp 0mp referenced this issue Apr 22, 2016

Merged

Executor module #68

@kaste kaste referenced this issue May 14, 2016

Merged

Remove cruft #38

bamarni added a commit to bamarni/dcos_cli that referenced this issue Oct 30, 2017

Ignore D203 with pydocstyle
As it's conflicting with another one...

cf. PyCQA/pydocstyle#141

bamarni added a commit to bamarni/dcos_cli that referenced this issue Nov 22, 2017

Ignore D203 with pydocstyle
As it's conflicting with another one...

cf. PyCQA/pydocstyle#141

@borela borela referenced this issue Sep 27, 2018

Merged

Use selector to detect syntax #11

2 of 2 tasks complete
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.