Skip to content

Commit 89e3d77

Browse files
chore: add comprehensive compliance checks to prevent linting errors
- Add backend-lint-check to pre-push hook - Add 'make compliance' and 'make check' targets - Checks formatting, linting, and type generation - Prevents duplicate function definitions and other errors
1 parent 598eeb4 commit 89e3d77

File tree

2 files changed

+21
-1
lines changed

2 files changed

+21
-1
lines changed

Makefile

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Holmes Development Makefile
22
# Cross-language orchestration for the monorepo
33

4-
.PHONY: install hooks dev-db stop-db adminer generate-types lint format migrate migrate-auth dev-backend dev-frontend
4+
.PHONY: install hooks dev-db stop-db adminer generate-types lint format migrate migrate-auth dev-backend dev-frontend check compliance
55

66
# Install all dependencies
77
install:
@@ -50,6 +50,24 @@ format:
5050
bun run format:frontend || true
5151
cd backend && uv run ruff format .
5252

53+
# Run comprehensive compliance checks (lint, format check, type generation)
54+
check: compliance
55+
56+
compliance:
57+
@echo "Running compliance checks..."
58+
@echo "\n==> Checking backend formatting..."
59+
cd backend && uv run ruff format --check .
60+
@echo "\n==> Checking backend linting..."
61+
cd backend && uv run ruff check .
62+
@echo "\n==> Checking type generation..."
63+
@$(MAKE) generate-types
64+
@if [ -n "$$(git status --porcelain packages/types/)" ]; then \
65+
echo "\n❌ Type generation produced changes. Run 'make generate-types' and commit."; \
66+
git diff -- packages/types/; \
67+
exit 1; \
68+
fi
69+
@echo "\n✅ All compliance checks passed!"
70+
5371
# Run Better Auth migrations (creates auth tables)
5472
migrate-auth:
5573
cd frontend && bunx @better-auth/cli migrate

lefthook.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ pre-push:
2626
commands:
2727
backend-format-check:
2828
run: cd backend && uv run ruff format --check .
29+
backend-lint-check:
30+
run: cd backend && uv run ruff check .
2931
generate-types:
3032
run: |
3133
make generate-types

0 commit comments

Comments
 (0)