-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
117 lines (89 loc) · 3.13 KB
/
Copy pathMakefile
File metadata and controls
117 lines (89 loc) · 3.13 KB
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
# Code Review Guardian — root Makefile (Docker workflow)
COMPOSE ?= docker compose
SERVICE_PHP ?= php
.PHONY: help ensure-up up down build shell install assets test test-coverage \
check-no-cursor-coauthor strip-cursor-coauthor-from-history \
cs-check cs-fix rector rector-dry phpstan qa release-check composer-sync \
clean update validate setup-hooks
help:
@echo "Code Review Guardian — make targets"
@echo ""
@echo "Container: up, down, build, shell"
@echo "Dependencies: install"
@echo "Assets: assets (no-op)"
@echo "Tests: test, test-coverage"
@echo "Quality: cs-check, cs-fix, rector, rector-dry, phpstan, qa"
@echo "Release: release-check, composer-sync"
@echo "Cleanup: clean"
@echo "Composer: update, validate"
@echo "Other: setup-hooks, ensure-up"
ensure-up:
@echo "Ensuring Docker environment is up..."
@$(COMPOSE) up -d --build
@sleep 10
@$(COMPOSE) exec -T $(SERVICE_PHP) composer install --no-interaction
up:
@$(COMPOSE) up -d --build
down:
@$(COMPOSE) down
build:
@$(COMPOSE) build --no-cache
shell: ensure-up
@$(COMPOSE) exec $(SERVICE_PHP) sh
install: ensure-up
@$(COMPOSE) exec -T $(SERVICE_PHP) composer install --no-interaction
assets:
@echo "No frontend assets in this bundle."
test: ensure-up
@$(COMPOSE) exec -T $(SERVICE_PHP) composer test
test-coverage: ensure-up
@$(COMPOSE) exec -T $(SERVICE_PHP) composer test-coverage | tee coverage-php.txt
@./.scripts/php-coverage-percent.sh coverage-php.txt
cs-check: ensure-up
@$(COMPOSE) exec -T $(SERVICE_PHP) composer cs-check
cs-fix: ensure-up
@$(COMPOSE) exec -T $(SERVICE_PHP) composer cs-fix
rector: ensure-up
@$(COMPOSE) exec -T $(SERVICE_PHP) composer rector
rector-dry: ensure-up
@$(COMPOSE) exec -T $(SERVICE_PHP) composer rector-dry
phpstan: ensure-up
@$(COMPOSE) exec -T $(SERVICE_PHP) composer phpstan
qa: ensure-up
@$(COMPOSE) exec -T $(SERVICE_PHP) composer qa
composer-sync: ensure-up
@$(COMPOSE) exec -T $(SERVICE_PHP) composer validate --strict
@$(COMPOSE) exec -T $(SERVICE_PHP) composer install --no-interaction
release-check: check-no-cursor-coauthor
@$(MAKE) ensure-up
@$(MAKE) composer-sync
@$(MAKE) cs-fix
@$(MAKE) cs-check
@$(MAKE) rector-dry
@$(MAKE) phpstan
@$(MAKE) test-coverage
clean:
rm -rf vendor
rm -rf .phpunit.cache
rm -rf coverage
rm -f coverage.xml
rm -f coverage-php.txt
rm -f .php-cs-fixer.cache
update: ensure-up
@$(COMPOSE) exec -T $(SERVICE_PHP) composer update
validate: ensure-up
@$(COMPOSE) exec -T $(SERVICE_PHP) composer validate --strict
check-no-cursor-coauthor:
@chmod +x .scripts/check-no-cursor-coauthor.sh
@./.scripts/check-no-cursor-coauthor.sh HEAD
setup-hooks:
@chmod +x .githooks/pre-commit 2>/dev/null || true
@chmod +x .githooks/commit-msg 2>/dev/null || true
@git config core.hooksPath .githooks
@echo "✅ Git hooks installed (.githooks — includes commit-msg for REQ-GIT-001)."
# REQ-MAKE-008: update-deps (REQ-MAKE-008)
BUNDLE_ROOT := $(abspath $(dir $(lastword $(MAKEFILE_LIST))))
include $(BUNDLE_ROOT)/../.scripts/Makefile.update-deps.mk
strip-cursor-coauthor-from-history:
@chmod +x .scripts/strip-cursor-coauthor-from-history.sh
@./.scripts/strip-cursor-coauthor-from-history.sh main