-
Notifications
You must be signed in to change notification settings - Fork 28.2k
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
Closed
Closed
Changes from 3 commits
Commits
Show all changes
26 commits
Select commit
Hold shift + click to select a range
61b4782
Add ESLint support.
sarutak e2fcd9e
Add a newline at the end of .gitignore.
sarutak 990e538
Modify .rat-exclude.
sarutak d6eb61a
Add docs/js for a lint target.
sarutak c1afc31
npm install -> npm ci to avoid package-lock.json being changed.
sarutak d858aa8
Upgrade eslint.
sarutak e459d90
Add switch-case rule.
sarutak 1ad98a5
Fix style for webui.js.
sarutak feb6d76
Disable indentation rule for member expressions.
sarutak 0a1a461
Fix style for utils.js.
sarutak 71ea913
Fix style for timeline-view.js.
sarutak 5ec9eea
Fix style for table.js.
sarutak 701514a
Fix style for structured-streaming-page.js.
sarutak 5b18e69
Fix style for streaming-page.js.
sarutak 1d209ca
Add ignored argument rule.
sarutak 4c8cb17
Fix style for stagepage.js.
sarutak 4884b8e
Fix style for spark-dag-viz.js.
sarutak da34039
Fix style for log-view.js.
sarutak 896b475
Modify indentation in eslint.json.
sarutak e8170eb
Fix style for initialize-tooltips.js.
sarutak e3847db
Fix style for historypage.js.
sarutak b129c4e
Fix style for historypage-common.js.
sarutak d174384
Fix style for executorspage.js.
sarutak 1d67631
Revert "Fix style for stagepage.js."
sarutak 82a9947
Merge branch 'master' of https://github.com/apache/spark into introdu…
sarutak 5bda9fc
Fix style for stagepage.js.
sarutak File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -134,3 +134,4 @@ flights_tiny.txt.1 | |
over1k | ||
over10k | ||
exported_table/* | ||
node_modules |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"env": { | ||
"browser": true, | ||
"es6": true | ||
}, | ||
"extends": "eslint:recommended", | ||
"rules": { | ||
"indent": ["error", 2] | ||
}, | ||
"ignorePatterns": ["*.min.js"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
#!/usr/bin/env bash | ||
|
||
# | ||
# Licensed to the Apache Software Foundation (ASF) under one or more | ||
# contributor license agreements. See the NOTICE file distributed with | ||
# this work for additional information regarding copyright ownership. | ||
# The ASF licenses this file to You under the Apache License, Version 2.0 | ||
# (the "License"); you may not use this file except in compliance with | ||
# the License. You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
# | ||
|
||
set -o pipefail | ||
|
||
SCRIPT_DIR="$( cd "$( dirname "$0" )" && pwd )" | ||
SPARK_ROOT_DIR="$(dirname $SCRIPT_DIR)" | ||
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/" | ||
) | ||
|
||
if ! type "npm" > /dev/null; then | ||
echo "ERROR: You should install npm" | ||
exit 1 | ||
fi | ||
|
||
if ! type "npx" > /dev/null; then | ||
echo "ERROR: You should install npx" | ||
exit 1 | ||
fi | ||
|
||
cd $SCRIPT_DIR | ||
|
||
if ! npm ls eslint > /dev/null; then | ||
npm install eslint | ||
fi | ||
|
||
npx eslint -c "$SPARK_ROOT_DIR/dev/eslint.json" $LINT_TARGET_FILES | tee "$LINT_JS_REPORT_FILE_NAME" | ||
lint_status=$? | ||
|
||
if [ "$lint_status" = "0" ] ; then | ||
echo "lint-js checks passed." | ||
else | ||
echo "lint-js checks failed." | ||
fi | ||
|
||
exit "$lint_status" |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.