Skip to content

Commit e9964b0

Browse files
authored
feat(git hooks): introduce husky (#1018)
1 parent 1fbce7c commit e9964b0

File tree

6 files changed

+923
-98
lines changed

6 files changed

+923
-98
lines changed

.github/pull_request_template.md

-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ If there is any impact on existing users (compatibility, degradation, breaking c
55

66
## Checklist
77

8-
- [ ] Executed `npm run lint`
98
- [ ] Modified relevant documentation
109
- [ ] Verified operation in local environment
1110
- [ ] Executed `npm run cdk:test` and if there are snapshot differences, execute `npm run cdk:test:update-snapshot` to update snapshots

.husky/pre-commit

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
npx lint-staged

docs/en/DEVELOPMENT.md

+14-2
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,22 @@ If executed successfully, it will start at http://localhost:5173, so please try
5454

5555
## When Submitting a Pull Request
5656

57-
We welcome Pull Requests for bug fixes and feature improvements. Before committing, please run the lint tool:
57+
We welcome Pull Requests for bug fixes and feature improvements :tada:
58+
59+
When `git commit` is executed, `npm run lint` is executed. But if it fails, the commit causes an error like the following:
60+
61+
```bash
62+
⚠ Running tasks for staged files...
63+
❯ package.json — 1 file
64+
**/* — 1 file
65+
✖ sh -c 'npm run lint' [FAILED]
66+
...
67+
```
68+
69+
If you want to ignore this error and create a Draft PR, add the `--no-verify` option as shown below.
5870

5971
```bash
60-
npm run lint
72+
git commit -m "xxx" --no-verify
6173
```
6274

6375
Also, if there are changes to the CDK, check the snapshots with the following command and update them:

docs/ja/DEVELOPMENT.md

+15-3
Original file line numberDiff line numberDiff line change
@@ -55,13 +55,25 @@ npm run web:dev
5555

5656
## Pull Request を出す場合
5757

58-
バグ修正や機能改善などの Pull Request は歓迎しております。コミットする前に、lint ツールを実行してください。
58+
バグ修正や機能改善などの Pull Request は歓迎しております :tada:
59+
60+
`git commit`が実行された際、`npm run lint`が実行されます。しかし、失敗すると、以下のようなエラーが発生します。
61+
62+
```bash
63+
⚠ Running tasks for staged files...
64+
❯ package.json — 1 file
65+
**/* — 1 file
66+
✖ sh -c 'npm run lint' [FAILED]
67+
...
68+
```
69+
70+
もし、このエラーを無視してDraft PR を作成したい場合は、以下のように `--no-verify` オプションを付けてください。
5971

6072
```bash
61-
npm run lint
73+
git commit -m "xxx" --no-verify
6274
```
6375

64-
また、CDK に変更があれば以下のコマンドでスナップショットの確認を行いスナップショットを更新してください。
76+
もしCDK に変更があれば以下のコマンドでスナップショットの確認を行いスナップショットを更新してください。
6577

6678
```bash
6779
# 差分を確認

0 commit comments

Comments
 (0)