diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 031ad51..1d22c86 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -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 .' diff --git a/Justfile b/Justfile index ae6b00a..f9f4a1d 100644 --- a/Justfile +++ b/Justfile @@ -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