-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
68 lines (55 loc) · 1.45 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
66
67
68
MAKEFLAGS += --warn-undefined-variables
SHELL := bash
PATH := $(CURDIR)/vendor/bin:$(PATH)
PSALM_FLAGS ?=
PHPUNIT_FLAGS ?=
export XDEBUG_MODE = coverage
# Help
.PHONY: help
help:
@echo 'Available targets:'
@echo ' vendor Installs composer dependencies'
@echo ' test Execute all tests'
@echo ' fix Fixes composer.json and code style'
@echo ' fix-prettier Fix code style of non PHP files (not included in "fix" target)'
# Build
vendor:
composer install --no-interaction
# Test
.PHONY: test
test: test-code-style test-psalm test-phpmd test-phpunit test-composer-normalize test-validate-composer
.PHONY: test-code-style
test-code-style: vendor
php-cs-fixer fix --dry-run --diff
.PHONY: test-psalm
test-psalm: vendor
psalm -m --no-progress ${PSALM_FLAGS}
.PHONY: test-phpunit
test-phpunit: vendor
phpunit ${PHPUNIT_FLAGS}
.PHONY: test-validate-composer
test-validate-composer:
composer validate
.PHONY: test-composer-normalize
test-composer-normalize: vendor
test-composer-normalize:
composer normalize --dry-run --diff
.PHONY: test-phpmd
test-phpmd: vendor
test-phpmd:
phpmd ./src text rulesets.xml
# Fix
.PHONY: fix
fix: fix-code-style fix-composer
.PHONY: fix-code-style
fix-code-style: vendor
fix-code-style:
php-cs-fixer -- fix
.PHONY: fix-composer
fix-composer: vendor
fix-composer:
composer normalize --no-update-lock
composer update nothing
.PHONY: fix-prettier
fix-prettier:
npx prettier@^2 . --write