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

Are D203 and D211 in conflict? #141

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

Are D203 and D211 in conflict? #141

jacebrowning opened this issue Oct 9, 2015 · 7 comments

Comments

@jacebrowning
Copy link
Contributor

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
Copy link
Contributor Author

I tend to just disable D203 in my projects.

@Nurdok
Copy link
Member

Nurdok commented Oct 9, 2015

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

@jacebrowning
Copy link
Contributor Author

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
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
Copy link
Contributor Author

Yes:

[pep257]

ignore = D202

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

@Nurdok
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
Copy link
Contributor Author

Thanks!

szhu added a commit to szhu/SublimeLinter-contrib-cjsx that referenced this issue Dec 28, 2015
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
bamarni added a commit to bamarni/dcos_cli that referenced this issue Oct 30, 2017
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
As it's conflicting with another one...

cf. PyCQA/pydocstyle#141
benclifford added a commit to Parsl/parsl that referenced this issue Nov 21, 2019
D203 is now disabled by default in flake8, so a parsl
level exclusion isn't necessary any more.

See PyCQA/pydocstyle#141
benclifford added a commit to Parsl/parsl that referenced this issue Nov 22, 2019
D203 is now disabled by default in flake8, so a parsl
level exclusion isn't necessary any more.

See PyCQA/pydocstyle#141
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

2 participants