-
Notifications
You must be signed in to change notification settings - Fork 28.9k
[SPARK-23367][Build] Include python document style checking #22425
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
Conversation
Pulling functionality from apache spark
pull latest from apache spark
Pulling functionality from apache spark
Pulling functionality from apache spark
pull request from apache/master
pull latest from apache spark
pull latest from apache spark
Pull apache spark
pull latest apache spark
Apache spark pull latest
Apache spark latest pull
apache spark latest pull
latest apache spark
apache spark latest
Apache Spark master latest
|
Test build #96086 has finished for PR 22425 at commit
|
srowen
left a comment
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 like the general idea, but this also turns off most checks? are there any that can be meaningfully re-enabled with a few fixes?
dev/tox.ini
Outdated
|
|
||
| [pycodestyle] | ||
| ignore=E226,E241,E305,E402,E722,E731,E741,W503,W504 | ||
| ignore=E226,E241,E305,E402,E722,E731,E741,W503,W504,W605 |
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.
Do we need to exclude 605? I thought we fixed all those...
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.
The intent of this PR was on pydocstyle changes, and this was pycodestyle break, so was unsure if that fix can be included in this PR. I had seen W605 code style broken in that build, and to make it pass added this. I agree completely the fix for W605 can be done with no-PR trivial fix., will check again.
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 just confused why this would need to be changed in this PR -- hopefully just a hold over from the previous PR?
| max-line-length=100 | ||
| exclude=cloudpickle.py,heapq3.py,shared.py,python/docs/conf.py,work/*/*.py,python/.eggs/*,dist/* | ||
| [pydocstyle] | ||
| ignore=D100,D101,D102,D103,D104,D105,D106,D107,D200,D201,D202,D203,D204,D205,D206,D207,D208,D209,D210,D211,D212,D213,D214,D215,D300,D301,D302,D400,D401,D402,D403,D404,D405,D406,D407,D408,D409,D410,D411,D412,D413,D414 |
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.
This is tiny, but is this blank line necessary? it seems to separate the heading from its content?
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.
Between [pydocstyle] to ignore is necessary and standard style. Post ignore the blank line was added as per requested by last reviewer on previous PR - #20556 (comment)
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.
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 just asked to add a line break at the end of file, and the current style looks good to me.
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.
EDIT: disregard, there isn't a blank line, it's just github display confusing me. Oops, sorry about that.
HyukjinKwon
left a comment
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 would also leave short explanations in PR description to justify why they should be skipped. Looks so many things are being skipped. FYI, this project does not yet claim PEP 257 as far as I know.
|
As per earlier discussions with prior reviewers, the intent of this PR was to make changes to enable pydocstyle but not to include all pydocstyle changes across all docs as that would need to be discussed later and be prioritized. I will relook at this again with your comments and check pydoc for style corrections.Thanks. Sorry @srowen @HyukjinKwon , I was waiting from Feb2018 to Jul2018 on the previous PR #20556 , and hence there is a bit of disconnect from this issue. Plus bit caught up at work and hence delay in providing context in which this PR was created. |
srowen
left a comment
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.
Ok I think it's fine to focus on enabling this tool here and then making changes later as we unexclude warnings.
I think we had separately fixed the w605 errors; might be worth checking if that's still needed.
holdenk
left a comment
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.
Thanks for reviving this PR I'm excited to get better style checkers integrated into Spark. My main concern is with the change to pycodestyle's list of excluded problems.
| max-line-length=100 | ||
| exclude=cloudpickle.py,heapq3.py,shared.py,python/docs/conf.py,work/*/*.py,python/.eggs/*,dist/* | ||
| [pydocstyle] | ||
| ignore=D100,D101,D102,D103,D104,D105,D106,D107,D200,D201,D202,D203,D204,D205,D206,D207,D208,D209,D210,D211,D212,D213,D214,D215,D300,D301,D302,D400,D401,D402,D403,D404,D405,D406,D407,D408,D409,D410,D411,D412,D413,D414 |
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.
dev/tox.ini
Outdated
|
|
||
| [pycodestyle] | ||
| ignore=E226,E241,E305,E402,E722,E731,E741,W503,W504 | ||
| ignore=E226,E241,E305,E402,E722,E731,E741,W503,W504,W605 |
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 just confused why this would need to be changed in this PR -- hopefully just a hold over from the previous PR?
|
Gentle ping, whats up? |
|
Thank you @srowen @holdenk @HyukjinKwon for your review. As per discussion, in this PR, we are enabling docstyle change but not updating pydocs. Hence tox.ini has doc error codes included.It can be taken off few at a time. pydocstyle is newer correct way of handling doc style issues over pep257. It covers both pep257 and numpy convention style. http://www.pydocstyle.org/en/3.0.0/error_codes.html updated pydocstyle to latest 3.0.0. |
|
Test build #97621 has finished for PR 22425 at commit
|
|
Test build #97820 has started for PR 22425 at commit |
| echo "flake8 checks passed." | ||
| fi | ||
|
|
||
| # Check python document style, skip check if pydocstyle is not installed. |
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.
Nit: the indentation below looks different (4-space) from the rest of the script (2-space)
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.
Actually, seems like indentation is inconsistent in this file, so let's leave it for now
| max-line-length=100 | ||
| exclude=cloudpickle.py,heapq3.py,shared.py,python/docs/conf.py,work/*/*.py,python/.eggs/*,dist/* | ||
| [pydocstyle] | ||
| ignore=D100,D101,D102,D103,D104,D105,D106,D107,D200,D201,D202,D203,D204,D205,D206,D207,D208,D209,D210,D211,D212,D213,D214,D215,D300,D301,D302,D400,D401,D402,D403,D404,D405,D406,D407,D408,D409,D410,D411,D412,D413,D414 |
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.
EDIT: disregard, there isn't a blank line, it's just github display confusing me. Oops, sorry about that.
|
Test build #97844 has started for PR 22425 at commit |
|
Test build #97836 has finished for PR 22425 at commit
|
|
I think the scaladoc error is unrelated, jenkins retest this please. |
|
Test build #98096 has finished for PR 22425 at commit
|
|
Merged to master. Anyone who feels like then addressing the style warnings, some that may be easy to address, go ahead. |
## What changes were proposed in this pull request? Includes python document style checking. - Use sphinx like check, run only if pydocstyle installed on machine/jenkins - use pydocstyle rather than single file version pep257.py, which is much older and had some known issues - verify pydocstyle latest 3.0.0 is in use, to ensure latest doc checks are getting executed - ignore (inclusion/exclusion error codes) features and support via tox.ini - Be non-breaking change and allow updating docstyle to standards at easy pace ## How was this patch tested? ./dev/run-tests Closes apache#22425 from rekhajoshm/SPARK-23367-2. Authored-by: Rekha Joshi <[email protected]> Signed-off-by: Sean Owen <[email protected]>
What changes were proposed in this pull request?
Includes python document style checking.
How was this patch tested?
./dev/run-tests