-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
55 lines (40 loc) · 1.4 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
# set all to phony
SHELL=bash
.PHONY: *
DOCKER_CGROUP:=$(shell cat /proc/1/cgroup | grep docker | wc -l)
ifneq ("$(wildcard /.dockerenv)","")
IN_DOCKER=TRUE
else ifneq ("$(DOCKER_CGROUP)","0")
IN_DOCKER=TRUE
else
IN_DOCKER=FALSe
endif
ifeq ("$(IN_DOCKER)","TRUE")
DOCKER_RUN=
else
DOCKER_RUN=docker run --rm -it \
-v "`pwd`:`pwd`" \
-w "`pwd`" \
"wyrihaximusnet/php:7.4-zts-alpine3.12-dev"
endif
all: lint cs-fix cs stan psalm unit infection composer-require-checker composer-unused
lint:
$(DOCKER_RUN) vendor/bin/parallel-lint --exclude vendor .
cs:
$(DOCKER_RUN) vendor/bin/phpcs --parallel=$(shell nproc)
cs-fix:
$(DOCKER_RUN) vendor/bin/phpcbf --parallel=$(shell nproc)
stan:
$(DOCKER_RUN) vendor/bin/phpstan analyse src tests --level max --ansi -c phpstan.neon
psalm:
$(DOCKER_RUN) vendor/bin/psalm --threads=$(shell nproc) --shepherd --stats
unit:
$(DOCKER_RUN) vendor/bin/phpunit --colors=always -c phpunit.xml.dist --coverage-text --coverage-html covHtml --coverage-clover ./build/logs/clover.xml
unit-ci: unit
if [ -f ./build/logs/clover.xml ]; then sleep 3; fi
infection:
$(DOCKER_RUN) vendor/bin/infection --ansi --min-msi=100 --min-covered-msi=100 --threads=$(shell nproc)
composer-require-checker:
$(DOCKER_RUN) vendor/bin/composer-require-checker --ignore-parse-errors --ansi -vvv --config-file=composer-require-checker.json
composer-unused:
$(DOCKER_RUN) composer unused --ansi