forked from apache/celeborn
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[CELEBORN-1240] Introduce Husky Configuration to Celeborn Web
 ### What changes were proposed in this pull request? - Added Husky to enforce code quality with automated tasks during Git events. - Added lint-staged for optimized linting on staged files before each commit. ### Why are the changes needed? Enhances code quality. ### Does this PR introduce _any_ user-facing change? No. ### How was this patch tested? Local test. Closes apache#2250 from tiny-dust/CELEBORN-1240. Lead-authored-by: tiny-dust <[email protected]> Co-authored-by: 周顺顺 <[email protected]> Signed-off-by: SteNicholas <[email protected]>
- Loading branch information
1 parent
5c54388
commit d315ff5
Showing
9 changed files
with
475 additions
and
8 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
# | ||
# 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. | ||
# | ||
|
||
name: Lint Check for Web | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
- branch-* | ||
pull_request: | ||
branches: | ||
- main | ||
- branch-* | ||
|
||
concurrency: | ||
group: style-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
lint: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: pnpm/action-setup@v2 | ||
with: | ||
version: 8 | ||
|
||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
# When updating node and pnpm version, also need to update the version in `web/pom.xml` | ||
- name: Use Node.js v20.11.0 | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: 20.11.0 | ||
|
||
- name: Use pnpm v8.14.3 | ||
uses: pnpm/action-setup@v2 | ||
with: | ||
version: 8.14.3 | ||
|
||
- name: Install dependencies | ||
run: pnpm install | ||
working-directory: ./web | ||
|
||
- name: Lint and format | ||
run: pnpm run lint | ||
working-directory: ./web |
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
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 |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# | ||
# 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. | ||
# | ||
|
||
#!/usr/bin/env sh | ||
|
||
. "$(dirname -- "$0")/_/husky.sh" | ||
|
||
cd web && pnpm run lint:lint-staged |
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
Oops, something went wrong.