-
Notifications
You must be signed in to change notification settings - Fork 28.9k
[SPARK-23367][Build] Include python document style checking #20556
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
|
Test build #87248 has finished for PR 20556 at commit
|
|
Test build #87249 has finished for PR 20556 at commit
|
|
build error unrelated to this PR. retest this please. |
dev/lint-python
Outdated
| SPARK_ROOT_DIR="$(dirname "$SCRIPT_DIR")" | ||
| # Exclude auto-generated configuration file. | ||
| PATHS_TO_CHECK="$( cd "$SPARK_ROOT_DIR" && find . -name "*.py" )" | ||
| DOC_PATHS_TO_CHECK="$( cd "$SPARK_ROOT_DIR" && find . -name "*.py" | grep -vF 'functions.py')" |
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: add an extra space between 'functions.py' and ).
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.
done
dev/lint-python
Outdated
| PYLINT_REPORT_PATH="$SPARK_ROOT_DIR/dev/pylint-report.txt" | ||
| PYLINT_INSTALL_INFO="$SPARK_ROOT_DIR/dev/pylint-info.txt" | ||
| PYDOCSTYLEBUILD="pydocstyle" | ||
| PYDOCSTYLEVERSION=$(python -c 'import pkg_resources; print pkg_resources.get_distribution("pydocstyle").version') |
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.
..; print(pkg_resources.get_distribution("pydocstyle").version)' 2> /dev/null)
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.
done
dev/tox.ini
Outdated
| max-line-length=100 | ||
| exclude=cloudpickle.py,heapq3.py,shared.py,python/docs/conf.py,work/*/*.py,python/.eggs/* | ||
| [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.
We need a line break at the end of the file.
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.
done
|
Test build #87439 has finished for PR 20556 at commit
|
dev/lint-python
Outdated
|
|
||
| # Check python document style, skip check if pydocstyle is not installed. | ||
| if hash "$PYDOCSTYLEBUILD" 2> /dev/null; then | ||
| if [ $PYDOCSTYLEVERSION == "2.1.1" ]; then |
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.
What happens when a new version of pydocstyle is released? Would the same rules below still work so that this check could be >= 2.1.1?
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.
done
dev/lint-python
Outdated
| lint_status=1 | ||
| fi | ||
|
|
||
| if [ "$lint_status" -ne 0 ]; then |
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.
could you just move this block above and get rid of lint_status?
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.
not sure i understand
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.
So if I understand @BryanCutler's request correctly, instead of setting linte_status in the if check above and then lint_status to determine if we should run the pydocstyle checker, just directly check the compile status and then run the pydocstyle checker on that.
That being said I think we could also drop the compile_status check since we would have already exited the script if it was non-zero at this point (I think).
|
Thanks for working on this! I like the idea of automated document style checking for Python :) |
|
Jenkins retest this please. |
|
Test build #87683 has finished for PR 20556 at commit
|
|
Test build #87688 has finished for PR 20556 at commit
|
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 working on this. Is this a thing you still have bandwidth to work on?
dev/lint-python
Outdated
| lint_status=1 | ||
| fi | ||
|
|
||
| if [ "$lint_status" -ne 0 ]; then |
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.
So if I understand @BryanCutler's request correctly, instead of setting linte_status in the if check above and then lint_status to determine if we should run the pydocstyle checker, just directly check the compile status and then run the pydocstyle checker on that.
That being said I think we could also drop the compile_status check since we would have already exited the script if it was non-zero at this point (I think).
dev/lint-python
Outdated
| rm "$PYDOCSTYLE_REPORT_PATH" | ||
| fi | ||
| else | ||
| echo "The pydocstyle version needs to be latest 2.1.1.Skipping pydoc checks for now" |
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: add a space between "2.1.1.Skipping" the final dot and skipping.
|
If your still working on this would be good to merge in the latest master branch. |
|
Are you still interested in this PR? |
|
Yes @holdenk , seems like I missed the last notification on it. Please let me look into it this weekend. Thanks. |
|
PR #22425 Closing this.Thanks |
|
Test build #96085 has finished for PR 20556 at commit
|
What changes were proposed in this pull request?
Includes python document style checking.
How was this patch tested?
./dev/run-tests