-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
Pin pylint to 1.7.5 and fix docstring styling #3408
Conversation
# AttributeError: 'NoneType' object has no attribute 'pattern | ||
pylint==1.7.5 | ||
|
||
prospector |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't prospector also be pinned?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"Maybe".
Read my comment below in this PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm torn on whether we pin these or not. We are fighting broken testing dependencies at least twice a month now. Pinning does help avoid this, but I don't think there is a strong reason to pin otherwise.
Well, it doesn't fail because of the Python exception when running prospector... but for some reason it runs twice So, I think we should remove the If I pin the |
I missunderstood the |
@@ -1,8 +1,13 @@ | |||
-r pip.txt | |||
maxcdn | |||
astroid | |||
pylint | |||
# prospector==0.12.6 currently has issues with pydocstyle |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I unppined this because I didn't find any error related with pydocstyle
. Besides, I think the new version works as it should.
Most of the errors are
that can be fixed by our |
prospector \ --profile-path=/home/humitos/rtfd/code/readthedocs.org \ --profile=prospector --die-on-tool-error \ | \ grep -e "^[a-z] \ > \ list-files.txt for x in `cat list-files.txt`; do \ docformatter \ --wrap-summaries=80 \ --wrap-descriptions=80 \ --pre-summary-newline \ --no-blank \ --in-place readthedocs/$x\ ; done
The sections as we use them are useful for rst style.
@@ -35,6 +35,15 @@ pep257: | |||
- D105 | |||
- D211 | |||
- D104 | |||
- D212 # Multi-line docstring summary should start at the first line |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
D213 and D212 are incompatible. We use D213
See: http://pep257.readthedocs.io/en/latest/error_codes.html
@@ -35,6 +35,15 @@ pep257: | |||
- D105 | |||
- D211 | |||
- D104 | |||
- D212 # Multi-line docstring summary should start at the first line | |||
- D107 # Missing docstring in __init__ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We usually put the docstring at the class level.
(I personally prefer in the __init__
, but... it just a preference)
@@ -35,6 +35,15 @@ pep257: | |||
- D105 | |||
- D211 | |||
- D104 | |||
- D212 # Multi-line docstring summary should start at the first line | |||
- D107 # Missing docstring in __init__ | |||
- D106 # Missing docstring in public nested class |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ignore this one because uses of class Meta:
which doesn't have docstrings.
- D406 # Section name should end with a newline ('Examples', not 'Examples::') | ||
- D407 # Missing dashed underline after section ('Examples') | ||
- D412 # No blank lines allowed between a section header and its content ('Examples') | ||
- D413 # Missing blank line after last section ('Examples') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ignore all of them because doesn't allow us to use rst like
Here you have a couple of examples::
one
two
three
inside the docstring.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me.
All the test should just pass with this new configuration.
There are a couple of PR that are failing just because of this.
For reviewers: check all the commits but ignore this one at first 4d10f2e (since it's a run of
docformatter
that produces many changes). I tried to explain the changes the best I could.