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
[SPARK-35175][BUILD] Add linter for JavaScript source files. #32274
Conversation
Kubernetes integration test starting |
Kubernetes integration test status failure |
Test build #137736 has finished for PR 32274 at commit
|
Modify lint-js.
Kubernetes integration test starting |
Kubernetes integration test status failure |
Test build #137762 has finished for PR 32274 at commit
|
LINT_JS_REPORT_FILE_NAME="$SPARK_ROOT_DIR/dev/lint-js-report.log" | ||
LINT_TARGET_FILES=( | ||
"$SPARK_ROOT_DIR/core/src/main/resources/org/apache/spark/ui/static/" | ||
"$SPARK_ROOT_DIR/sql/core/src/main/resources/org/apache/spark/sql/execution/ui/static/" |
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 curious, should the dir: $SPARK_ROOT_DIR/docs/js/" be added to the
LINT_TARGET_FILES` ?
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.
Hmm, it seems that some files should be checked. Thanks.
Does all the current JS pass the linter? |
As I noted in the description, not yet. |
Kubernetes integration test starting |
Kubernetes integration test status failure |
Test build #137903 has finished for PR 32274 at commit
|
This reverts commit 4c8cb17.
@srowen I fixed style based on the current rule and now the linter passes. |
Kubernetes integration test starting |
Kubernetes integration test status failure |
Kubernetes integration test unable to build dist. exiting with code: 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.
Looks OK pending tests. I think a one-time cleanup is OK if we have a linter to enforce checks. It looks mostly like indentation changes.
Test build #138207 has finished for PR 32274 at commit
|
Test build #138210 has finished for PR 32274 at commit
|
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 idea. Didn't take a close look but I think it's good enough. cc @gengliangwang too fyi
Merged to |
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.
Late LGTM. I just tried it locally and it works!
### What changes were proposed in this pull request? SPARK-35175 (#32274) added a linter for JS so let's add it to GA. ### Why are the changes needed? To JS code keep clean. ### Does this PR introduce _any_ user-facing change? No. ### How was this patch tested? GA Closes #32512 from sarutak/ga-lintjs. Authored-by: Kousuke Saruta <sarutak@oss.nttdata.com> Signed-off-by: Hyukjin Kwon <gurwls223@apache.org>
What changes were proposed in this pull request?
This PR proposes to add linter for JavaScript source files.
ESLint seems to be a popular linter for JavaScript so I choose it.
Why are the changes needed?
Linter enables us to check style and keeps code clean.
Does this PR introduce any user-facing change?
No.
How was this patch tested?
Manually run
dev/lint-js
(Node.js and npm are required).In this PR, mainly indentation style is also fixed an linter passes.