Skip to content
This repository was archived by the owner on Oct 30, 2024. It is now read-only.

Commit 2bcffa9

Browse files
committed
Better Makefile
* Removed phpcs from composer ( it is sloooooooow ). * Getting it using wget as phar executable package.
1 parent 099c082 commit 2bcffa9

2 files changed

Lines changed: 21 additions & 19 deletions

File tree

Makefile

Lines changed: 21 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,29 @@
1+
CLEAN_FILES = bin build cover vendor docs/api composer.phar composer.lock phpDocumentor.phar
2+
SOURCE_CODE_PATHS = src test examples
3+
API_DOCS_PATH = ./docs/api
4+
COVERAGE_PATH = ./cover
5+
16
lint: lint-php lint-psr2 lint-squiz
27

38
.PHONY: lint-php
49
lint-php:
5-
find src -name *.php -exec php -l {} \;
6-
find test -name *.php -exec php -l {} \;
7-
find spec -name *.php -exec php -l {} \;
8-
find examples -name *.php -exec php -l {} \;
10+
find $(SOURCE_CODE_PATHS) spec -name *.php -exec php -l {} \;
911

1012
.PHONY: lint-psr2
1113
lint-psr2:
12-
#./vendor/bin/phpcbf --standard=PSR2 src test examples
13-
./vendor/bin/phpcs --standard=PSR2 --colors -w -s --warning-severity=0 src test examples
14+
# wget -qhttps://squizlabs.github.io/PHP_CodeSniffer/phpcbf.phar -O ./phpcbf.phar
15+
# ./vendor/bin/phpcbf --standard=PSR2 $(CODE_SOURCES)
16+
wget -q https://squizlabs.github.io/PHP_CodeSniffer/phpcs.phar -O ./phpcs.phar
17+
chmod +x phpcs.phar
18+
./phpcs.phar --standard=PSR2 --colors -w -s --warning-severity=0 $(SOURCE_CODE_PATHS)
1419

1520
.PHONY: lint-squiz
1621
lint-squiz:
17-
# ./vendor/bin/phpcbf --standard=Squiz,./ruleset.xml src test examples
18-
./vendor/bin/phpcs --standard=Squiz,./ruleset.xml --colors -w -s --warning-severity=0 src test examples
22+
# wget -qhttps://squizlabs.github.io/PHP_CodeSniffer/phpcbf.phar -O ./phpcbf.phar
23+
# ./vendor/bin/phpcbf --standard=Squiz,./ruleset.xml $(CODE_SOURCES)
24+
wget -q https://squizlabs.github.io/PHP_CodeSniffer/phpcs.phar -O ./phpcs.phar
25+
chmod +x phpcs.phar
26+
./phpcs.phar --standard=Squiz,./ruleset.xml --colors -w -s --warning-severity=0 $(SOURCE_CODE_PATHS)
1927

2028

2129
test: test-tdd test-bdd
@@ -29,28 +37,23 @@ test-bdd:
2937
./vendor/bin/phpspec run --format=pretty -v
3038

3139
cover:
32-
./vendor/bin/phpunit --coverage-html ./cover test
40+
./vendor/bin/phpunit --coverage-html $(COVERAGE_PATH) test
3341

3442
deps:
3543
wget -q https://getcomposer.org/composer.phar -O ./composer.phar
3644
chmod +x composer.phar
37-
php composer.phar install
45+
./composer.phar install
3846

3947
dist-clean:
40-
rm -rf bin
41-
rm -rf vendor
42-
rm -f composer.phar
43-
rm -f composer.lock
44-
rm -f phpDocumentor.phar
45-
rm -rf docs/api
48+
rm -rf $(CLEAN_FILES)
4649

4750
docker-nats:
4851
docker run --rm -p 8222:8222 -p 4222:4222 -d --name nats-main nats
4952

5053
phpdoc:
5154
wget -q https://github.com/phpDocumentor/phpDocumentor2/releases/download/v2.9.0/phpDocumentor.phar -O ./phpDocumentor.phar
5255
chmod +x phpDocumentor.phar
53-
./phpDocumentor.phar -d ./src/ -t ./docs/api --template=checkstyle --template=responsive-twig
56+
./phpDocumentor.phar -d ./src/ -t $(API_DOCS_PATH) --template=checkstyle --template=responsive-twig
5457

5558
serve-phpdoc:
56-
cd docs/api && php -S localhost:8000 && cd ../..
59+
cd $(API_DOCS_PATH) && php -S localhost:8000 && cd ../..

composer.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
"require-dev": {
1111
"phpunit/phpunit": "5.*",
1212
"satooshi/php-coveralls": "dev-master",
13-
"squizlabs/php_codesniffer": "~2.0",
1413
"phpspec/phpspec": "~2.0"
1514
},
1615
"authors": [

0 commit comments

Comments
 (0)