-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(githooks): add pre-commit and pre-push hooks
This commit introduces two new git hooks: pre-commit and pre-push. The pre-commit hook runs secretlint on staged files, while the pre-push hook runs lint and check scripts. Additionally, a new "prepare" script has been added to package.json to set the local git hooks path.
- Loading branch information
Showing
3 changed files
with
12 additions
and
1 deletion.
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,6 @@ | ||
#!/usr/bin/env sh | ||
|
||
# get the list of staged files | ||
files=$(git diff --cached --name-only --diff-filter=ACM --relative="") | ||
|
||
pnpm dlx @secretlint/quick-start $files |
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,4 @@ | ||
#!/usr/bin/env sh | ||
|
||
pnpm lint | ||
pnpm check |
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