Skip to content

Commit 9b66094

Browse files
authored
Merge pull request #133 from zero-one-group/chore/setup-pre-commit-hooks
Chore/setup pre commit hooks
2 parents 9ed7143 + 853881e commit 9b66094

3 files changed

Lines changed: 14 additions & 1 deletion

File tree

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@ terraform.tfvars*
112112
# moon
113113
.moon/cache
114114
.moon/docker
115+
.moon/hooks
115116

116117
# python
117118
__pycache__/

.moon/workspace.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,10 @@ vcs:
1212
# @see: https://moonrepo.dev/docs/config/workspace#hooks
1313
hooks:
1414
pre-commit:
15-
- moon run :format --affected --status=all
1615
- moon run :lint --affected --status=staged
16+
- moon run :format --affected --status=all
17+
commit-msg:
18+
- 'if ! grep -qE "^(feat|fix|chore|docs|style|refactor|perf|test|build|ci|revert)(\(.+\))?!?: .+" "$1"; then echo ""; echo "ERROR: Invalid commit message format."; echo "Expected: <type>(<optional-scope>): <description>"; echo "Types: feat, fix, chore, docs, style, refactor, perf, test, build, ci, revert"; echo ""; exit 1; fi'
1719
sync: false
1820

1921
hasher:

apps/react-app/moon.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,16 @@ tasks:
2929
runDepsInParallel: false
3030
envFile: '.env'
3131

32+
lint:
33+
command: 'biome lint'
34+
options:
35+
affectedFiles: true
36+
37+
format:
38+
command: 'biome check --write'
39+
options:
40+
affectedFiles: true
41+
3242
build:
3343
command: 'pnpm run build'
3444
deps: ['prebuild']

0 commit comments

Comments
 (0)