-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
65 lines (51 loc) · 2.27 KB
/
Makefile
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
.PHONY:
build:
docker build -t php-metrics-tools .
.PHONY:
check:
@if [ -z "$(TARGET_DIR)" ]; then\
echo 'TARGET_DIRの環境変数を設定してください';\
echo 'ex: export TARGET_DIR=/Path/To/Target/Dir';\
exit 1;\
else\
echo "TARGET_DIR: $(TARGET_DIR)";\
fi
.PHONY:
phpcpd: check
@docker run --rm -v ${TARGET_DIR}:/app:ro -v ${PWD}:/work php-metrics-tools phpcpd --exclude "vendor" --exclude="tests" --exclude="storage" ./
.PHONY:
lizard: check
@docker run --rm -v ${TARGET_DIR}:/app:ro -v ${PWD}:/work php-metrics-tools lizard -l php -s cyclomatic_complexity -x"*/vendor/*" -x"*/tests/*" -x"*/storage/*" ./
.PHONY:
churn: check
@docker run --rm -v ${TARGET_DIR}:/app:ro -v ${PWD}:/work php-metrics-tools churn run --configuration=/work/config/churn.yml --ansi ./
.PHONY:
phpmd: check
@docker run --rm -v ${TARGET_DIR}:/app:ro -v ${PWD}:/work php-metrics-tools phpmd --exclude "*vendor/*,*tests/*,*/storage/*,*/database/*" ./ ansi unusedcode
.PHONY:
phpstan: check
@docker run --rm -v ${TARGET_DIR}:/app:ro -v ${PWD}:/work php-metrics-tools phpstan --memory-limit=2G analyze -c /work/config/phpstan.neon --ansi ./
.PHONY:
rector: check
@docker run --rm -v ${TARGET_DIR}:/app:ro -v ${PWD}:/work php-metrics-tools rector process --dry-run --config=/work/config/rector.php --ansi
.PHONY:
phpmetrics: check
@docker run --rm -v ${TARGET_DIR}:/app:ro -v ${PWD}:/work php-metrics-tools phpmetrics --config=/work/config/phpmetrics.yml ./
.PHONY:
composer-unused: check
@docker run --rm -v ${TARGET_DIR}:/app:ro -v ${PWD}:/work php-metrics-tools composer-unused --ansi
.PHONY:
phpmnd: check
@docker run --rm -v ${TARGET_DIR}:/app:ro -v ${PWD}:/work php-metrics-tools phpmnd ./ --exclude=vendor --exclude=tests --exclude=strage --ansi
.PHONY:
phpcs: check
@docker run --rm -v ${TARGET_DIR}:/app:ro -v ${PWD}:/work php-metrics-tools phpcs --standard=/work/config/phpcs.xml --colors ./
.PHONY:
php-cs-fixer: check
@docker run --rm -v ${TARGET_DIR}:/app:ro -v ${PWD}:/work php-metrics-tools php-cs-fixer fix ./ --dry-run --diff --ansi --config=/work/config/.php-cs-fixer.dist.php
.PHONY:
phpinsights: check
@docker run --rm -v ${TARGET_DIR}:/app:ro -v ${PWD}:/work php-metrics-tools phpinsights analyse --config-path=/work/config/phpinsights.php --ansi ./
.PHONY:
test:
bats tests/