fix: pre-commit hooks for monorepo (golangci-lint cd, web deps, branch skip)

This commit is contained in:
2026-04-07 03:04:06 +02:00
parent 7bddf018e6
commit ca86001e7b
2 changed files with 11 additions and 10 deletions

View File

@@ -13,15 +13,15 @@ repos:
- id: no-commit-to-branch
args: ['--branch', 'main']
- repo: https://github.com/golangci/golangci-lint
rev: v2.1.6
hooks:
- id: golangci-lint
files: ^backend/
args: ['--config', 'backend/.golangci.yml']
- repo: local
hooks:
- id: golangci-lint
name: golangci-lint
entry: bash -c 'cd backend && golangci-lint run --config .golangci.yml ./...'
language: system
files: ^backend/.*\.go$
pass_filenames: false
- id: go-fmt
name: go fmt
entry: bash -c 'cd backend && gofmt -w .'

View File

@@ -74,10 +74,11 @@ test: backend-test
# Run all formatters
fmt: backend-fmt web-fmt
# Install pre-commit hooks
# Install pre-commit hooks and ensure web deps are present
hooks-install:
pre-commit install
pnpm --dir web install --frozen-lockfile
# Run all pre-commit hooks against all files
# Run all pre-commit hooks against all files (skips branch protection — use feature branches for commits)
hooks-run:
pre-commit run --all-files
SKIP=no-commit-to-branch pre-commit run --all-files