forked from rpkamp/mailhog-client
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
38 lines (29 loc) · 913 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
# List available commands
help:
@awk '/^#/{c=substr($$0,3);next}c&&/^[[:alpha:]][[:alnum:]_-]+:/{print substr($$1,1,index($$1,":")),c}1{c=0}' $(MAKEFILE_LIST) | column -s: -t
# Run all tests
test: lint code-style unit-tests phpstan #composer-require-checker
# Lint all php files
lint:
vendor/bin/parallel-lint --exclude vendor/ .
# Check code for style problems
code-style: phpmd phpcs
# Check code for design problems
phpmd:
vendor/bin/phpmd src/ xml phpmd.xml --suffixes php
# Check code adheres to PSR-2
phpcs:
vendor/bin/phpcs
# Run unit tests
unit-tests:
ifeq ($(CI),true)
vendor/bin/phpunit --testdox -v --coverage-clover=coverage.xml
else
vendor/bin/phpunit --testdox -v
endif
phpstan:
vendor/bin/phpstan analyze -c phpstan.neon
composer-require-checker:
vendor/bin/composer-require-checker
.PHONY: help test lint code-style phpmd phpcs unit-tests phpstan
.PHONY: composer-require-checker