feat: add pre-commit hooks for SQLx preparation, backend check, and frontend linting
This commit is contained in:
parent
d22f8cc292
commit
2df96e966d
18
.pre-commit-config.yaml
Normal file
18
.pre-commit-config.yaml
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
repos:
|
||||||
|
- repo: local
|
||||||
|
hooks:
|
||||||
|
- id: sqlx-prepare
|
||||||
|
name: sqlx prepare
|
||||||
|
language: script
|
||||||
|
entry: ./script/sqlx-prepare.sh
|
||||||
|
pass_filenames: false
|
||||||
|
- id: backend-check
|
||||||
|
name: backend check
|
||||||
|
language: system
|
||||||
|
entry: ./script/backend-check.sh
|
||||||
|
pass_filenames: false
|
||||||
|
- id: frontend-lint
|
||||||
|
name: frontend lint
|
||||||
|
language: system
|
||||||
|
entry: ./script/frontend-lint.sh
|
||||||
|
pass_filenames: false
|
6
script/backend-check.sh
Executable file
6
script/backend-check.sh
Executable file
@ -0,0 +1,6 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
SCRIPT_DIR=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd)
|
||||||
|
|
||||||
|
cd "$SCRIPT_DIR/../backend"
|
||||||
|
cargo check
|
6
script/frontend-lint.sh
Executable file
6
script/frontend-lint.sh
Executable file
@ -0,0 +1,6 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
SCRIPT_DIR=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd)
|
||||||
|
|
||||||
|
cd "$SCRIPT_DIR/../frontend"
|
||||||
|
pnpm lint
|
6
script/sqlx-prepare.sh
Executable file
6
script/sqlx-prepare.sh
Executable file
@ -0,0 +1,6 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
SCRIPT_DIR=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd)
|
||||||
|
|
||||||
|
cd "$SCRIPT_DIR/../backend"
|
||||||
|
cargo sqlx prepare --workspace
|
Loading…
x
Reference in New Issue
Block a user