-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
48 lines (32 loc) · 892 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
### Variables
# Applications
COMPOSER ?= /usr/bin/env composer
### Helpers
all: clean depend
.PHONY: all
### Dependencies
depend:
${COMPOSER} install --no-progress --prefer-source
.PHONY: depend
### QA
qa: lint phpcs phpmd
lint:
find ./src -name "*.php" -exec /usr/bin/env php -l {} \; | grep "Parse error" > /dev/null && exit 1 || exit 0
find ./test -name "*.php" -exec /usr/bin/env php -l {} \; | grep "Parse error" > /dev/null && exit 1 || exit 0
phploc:
vendor/bin/phploc src
phpmd:
vendor/bin/phpmd --suffixes php src/ text codesize,design,naming,unusedcode,controversial
phpcs:
vendor/bin/phpcs --standard=PSR2 --extensions=php src/ test/
phpcbf:
vendor/bin/phpcbf --standard=PSR2 --extensions=php src/ test/
.PHONY: qa lint phploc phpmd phpcs phpcpd
### Testing
test:
vendor/bin/phpunit -v --colors
.PHONY: test
### Cleaning
clean:
rm -rf vendor
.PHONY: clean