-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlefthook.yml
49 lines (46 loc) · 1.65 KB
/
lefthook.yml
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
commit-msg:
parallel: true
commands:
lint-commit-msg:
run: yarn commitlint --edit
# spell-check:
# run: yarn cspell --no-summary {1}
pre-commit:
parallel: true
commands:
prettier:
# glob: "*.{js,ts,tsx,json}"
# run: |
# yarn prettier --write $(echo {staged_files} | sed -e 's/js\///g')
# git add $(echo {staged_files} | sed -e 's/js\///g')
glob: "*.{js,ts,tsx,json}"
# run: |
# echo "Running Prettier"
# echo {staged_files} | tr ' ' '\n' | grep -E "\.(js|ts|tsx|json)$" | xargs -I {} sh -c 'yarn prettier --write "{}" && git add "{}"'
run: |
echo "Running Prettier"
for file in $(echo {staged_files} | tr ' ' '\n' | grep -E "\.(js|ts|tsx|json)$"); do
yarn prettier --write "$file" && git add "$file"
done
frontend-lint:
root: "frontend/react-app"
glob: "**/*.{js,ts,jsx,tsx,json}"
run: yarn run lint {staged_files}
# glob: "**/*.{js,ts,jsx,tsx,json}"
# run: |
# echo "Running Frontend Lint"
# echo {staged_files} | tr ' ' '\n' | grep -E "\.(js|ts|jsx|tsx|json)$" | xargs -I {} sh -c 'yarn --cwd frontend/react-app run lint "{}"'
backend-lint:
root: "backend/nest-backend"
run: yarn run lint {staged_files}
# root: "backend/nest-backend"
# run: |
# echo "Running Backend Lint"
# echo {staged_files} | tr ' ' '\n' | grep -E "\.(js|ts|jsx|tsx|json)$" | xargs -I {} sh -c 'yarn --cwd backend/nest-backend run lint "{}"'
pre-push:
parallel: true
commands:
branchName:
run: |
echo "Running validate-branch-name"
yarn validate-branch-name