-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
57 lines (31 loc) · 1019 Bytes
/
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
COMPOSER ?= composer
PHPUNIT_OPTS =
composer:
$(COMPOSER) install
fix:
vendor/bin/php-cs-fixer fix
fix-diff:
./vendor/bin/php-cs-fixer fix --diff --dry-run -v
test: composer
vendor/bin/phpunit -c .
lint: lint-php phpcs fix-diff lint-composer lint-eol
@echo All good.
lint-eol:
@echo "\n==> Validating unix style line endings of files:files"
@! grep -lIUr --color '^M' src/ composer.json composer.lock || ( echo '[ERROR] Above files have CRLF line endings' && exit 1 )
@echo All files have valid line endings
lint-composer:
@echo "\n==> Validating composer.json and composer.lock:"
$(COMPOSER) validate --strict
lint-php:
@echo "\n==> Validating all php files:"
@find src tests -type f -name \*.php | while read file; do php -l "$$file" || exit 1; done
phpcs:
vendor/bin/phpcs
coverage: composer
vendor/bin/phpunit -c .
outdated:
$(COMPOSER) outdated
ci: composer lint test outdated
@echo "All quality checks passed"
.PHONY: test composer coverage phpcs php-cs lint lint-php ci