From 8b2b46a113b6d96f9a41b874bab497d2ef1fecb8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20M=C3=B6ller?= Date: Sat, 24 Aug 2019 09:41:55 +0200 Subject: [PATCH 1/4] Enhancement: Declare phony targets at start of Makefile --- Makefile | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index bad1dc419d..3560b45ee0 100644 --- a/Makefile +++ b/Makefile @@ -1,14 +1,13 @@ +.PHONY: fix sniff test + vendor/autoload.php: composer install --no-interaction --prefer-dist -.PHONY: fix fix: vendor/autoload.php vendor/bin/phpcbf --standard=PSR2 src -.PHONY: sniff sniff: vendor/autoload.php vendor/bin/phpcs --standard=PSR2 src -n -.PHONY: test test: vendor/autoload.php vendor/bin/phpunit --verbose From f66a8a0a6e47f27c60e85b680c771eb374ab6cdf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20M=C3=B6ller?= Date: Sat, 24 Aug 2019 09:46:06 +0200 Subject: [PATCH 2/4] Enhancement: Keep targets sorted by name --- Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 3560b45ee0..93b3894442 100644 --- a/Makefile +++ b/Makefile @@ -1,8 +1,5 @@ .PHONY: fix sniff test -vendor/autoload.php: - composer install --no-interaction --prefer-dist - fix: vendor/autoload.php vendor/bin/phpcbf --standard=PSR2 src @@ -11,3 +8,6 @@ sniff: vendor/autoload.php test: vendor/autoload.php vendor/bin/phpunit --verbose + +vendor/autoload.php: + composer install --no-interaction --prefer-dist From 94b690e736d8f65cb8f510ce2486224428fba31d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20M=C3=B6ller?= Date: Sun, 25 Aug 2019 09:44:47 +0200 Subject: [PATCH 3/4] Enhancement: Add build target which runs fix and test targets to Makefile --- Makefile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 93b3894442..a7fb5766db 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,6 @@ -.PHONY: fix sniff test +.PHONY: build fix sniff test + +build: fix test fix: vendor/autoload.php vendor/bin/phpcbf --standard=PSR2 src From 3d6c84bec7957851daad5c9d81b881619d11709e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20M=C3=B6ller?= Date: Sun, 25 Aug 2019 09:46:00 +0200 Subject: [PATCH 4/4] Enhancement: Add help as first target to Makefile --- Makefile | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index a7fb5766db..5f76478944 100644 --- a/Makefile +++ b/Makefile @@ -1,14 +1,17 @@ -.PHONY: build fix sniff test +.PHONY: build fix help sniff test -build: fix test +help: + @grep -E '^[a-zA-Z0-9_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}' -fix: vendor/autoload.php +build: fix test ## Runs fix and test targets + +fix: vendor/autoload.php ## Fixes code style issues with phpcbf vendor/bin/phpcbf --standard=PSR2 src -sniff: vendor/autoload.php +sniff: vendor/autoload.php ## Detects code style issues with phpcs vendor/bin/phpcs --standard=PSR2 src -n -test: vendor/autoload.php +test: vendor/autoload.php ## Runs tests with phpunit vendor/bin/phpunit --verbose vendor/autoload.php: