-
Notifications
You must be signed in to change notification settings - Fork 53
/
lefthook.yml
53 lines (53 loc) · 3.18 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
50
51
52
53
pre-commit:
parallel: true
commands:
spotless:
root: "backend/"
glob: "*.java"
run: ./gradlew spotlessApply && git add {staged_files}
prettier:
root: "frontend/"
glob: "*.{js,ts,jsx,tsx}"
run: ./node_modules/.bin/prettier --write {staged_files} && git add {staged_files}
eslint:
root: "frontend/"
glob: "*.{js,ts,jsx,tsx}"
run: ./node_modules/.bin/eslint --fix {staged_files} && git add {staged_files}
stylelint:
root: "frontend/"
glob: "*.scss"
run: ./node_modules/.bin/stylelint --fix {staged_files} && git add {staged_files}
prettier-func:
root: "ops/services/app_functions/report_stream_batched_publisher/functions/"
glob: "*.{js,ts,jsx,tsx}"
run: ./node_modules/.bin/prettier --write {staged_files} && git add {staged_files}
eslint-func:
root: "ops/services/app_functions/report_stream_batched_publisher/functions/"
glob: "*.{js,ts,jsx,tsx}"
run: ./node_modules/.bin/eslint --fix {staged_files} && git add {staged_files}
in-docker:
parallel: true
commands:
spotless:
glob: "*.java"
run: docker compose run --rm backend sh -c "gradle spotlessApply" && git add {staged_files}
prettier:
root: "frontend/"
glob: "*.{js,ts,jsx,tsx}"
run: docker compose -f ../docker-compose.yml run --rm frontend sh -c "/app/frontend/node_modules/.bin/prettier --config /app/frontend/package.json --write {staged_files}" && git add {staged_files}
eslint:
root: "frontend/"
glob: "*.{js,ts,jsx,tsx}"
run: docker compose -f ../docker-compose.yml run --rm frontend sh -c "/app/frontend/node_modules/.bin/eslint --config /app/frontend/package.json --resolve-plugins-relative-to /app/frontend --fix {staged_files}" && git add {staged_files}
stylelint:
root: "frontend/"
glob: "*.scss"
run: docker compose -f ../docker-compose.yml run --rm frontend sh -c "/app/frontend/node_modules/.bin/stylelint --config /app/frontend/.stylelintrc.json --config-basedir /app/frontend --fix {staged_files}" && git add {staged_files}
prettier-func:
root: "ops/services/app_functions/report_stream_batched_publisher/functions"
glob: "*.{js,ts,jsx,tsx}"
run: docker compose -f ../docker-compose.yml run --rm ops/services/app_functions/report_stream_batched_publisher/functions sh -c "/app/ops/services/app_functions/report_stream_batched_publisher/functions/node_modules/.bin/prettier --config /app/ops/services/app_functions/report_stream_batched_publisher/functions/package.json --write {staged_files}" && git add {staged_files}
eslint-func:
root: "ops/services/app_functions/report_stream_batched_publisher/functions"
glob: "*.{js,ts,jsx,tsx}"
run: docker compose -f ../docker-compose.yml run --rm ops/services/app_functions/report_stream_batched_publisher/functions sh -c "/app/ops/services/app_functions/report_stream_batched_publisher/functions/node_modules/.bin/eslint --config /app/ops/services/app_functions/report_stream_batched_publisher/functions/package.json --resolve-plugins-relative-to /app/ops/services/app_functions/report_stream_batched_publisher/functions --fix {staged_files}" && git add {staged_files}