-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlefthook.yml
More file actions
34 lines (34 loc) · 1.02 KB
/
Copy pathlefthook.yml
File metadata and controls
34 lines (34 loc) · 1.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
glob_matcher: doublestar
post-merge:
jobs:
- name: prepare
script: prepare.sh
runner: bash
pre-push:
jobs:
- name: check
script: check.sh
runner: bash
pre-commit:
jobs:
- name: cleanup
glob: '**/*.{astro,cjs,css,cts,gql,graphql,hbs,htm,html,java,js,json,json5,jsonc,jsx,less,md,mdx,mjs,mts,scss,svelte,toml,ts,tsx,vue,yaml,yml}'
run: |-
[ -d node_modules ] || bun install --frozen-lockfile || exit
bun wb lint --fix --format -- {staged_files}
stage_fixed: true
- name: check-migrations
glob: '**/migration.sql'
run: |-
failed=0
for file in {staged_files}; do
if grep -q 'Warnings:' "$file"; then
echo "Migration SQL file ($file) contains warnings! Please solve the warnings and commit again."
failed=1
fi
done
exit "$failed"
- name: normalize-bun-lockfile
glob: bun.lock
run: bash .lefthook/normalize-bun-lockfile.sh {staged_files}
stage_fixed: true