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

Commit bd089ea

Browse files
authored
Merge pull request repejota#124 from repejota/issue/120-self-document-makefile
Issue/120 self document makefile
2 parents ca1b211 + ff9890b commit bd089ea

2 files changed

Lines changed: 17 additions & 7 deletions

File tree

Makefile

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ define require_phar
1212
@[ -f ./$(1) ] || wget -q $(2) -O ./$(1) && chmod +x $(1);
1313
endef
1414

15+
lint: ## Lint source code
1516
lint: lint-php lint-psr2 lint-squiz
1617

1718
.PHONY: lint-php
@@ -29,6 +30,7 @@ lint-squiz:
2930
./phpcs.phar --standard=Squiz,./ruleset.xml --colors -w -s --warning-severity=0 $(SOURCE_CODE_PATHS)
3031

3132

33+
test: ## Execute all tests suites TDD and BDD
3234
test: test-tdd test-bdd
3335

3436
.PHONY: test-tdd
@@ -39,26 +41,29 @@ test-tdd:
3941
test-bdd:
4042
./vendor/bin/phpspec run --format=pretty -v
4143

42-
cover:
44+
cover: ## Generate coverage report
4345
./vendor/bin/phpunit --coverage-html $(COVERAGE_PATH) test
4446

45-
deps:
47+
deps: ## Install dependencies
4648
$(call require_phar,composer.phar,$(COMPOSER_PHAR))
4749
./composer.phar install --no-dev
4850

49-
dev-deps:
51+
dev-deps: ## Install development dependencies
5052
$(call require_phar,composer.phar,$(COMPOSER_PHAR))
5153
./composer.phar install
5254

53-
dist-clean:
55+
dist-clean: ## Clean developer files, dependenciers and temporary files
5456
rm -rf $(CLEAN_PATHS)
5557

56-
docker-nats:
58+
docker-nats: ## Start NATS container ( for testing purposes )
5759
docker run --rm -p 8222:8222 -p 4222:4222 -d --name nats-main nats
5860

59-
phpdoc:
61+
phpdoc: ## Generate phpdoc API documentation
6062
$(call require_phar,phpdoc.phar,$(PHPDOCUMENTOR_PHAR_URL))
6163
./phpdoc.phar -d ./src/ -t $(API_DOCS_PATH) --template=checkstyle --template=responsive-twig
6264

63-
serve-phpdoc:
65+
serve-phpdoc: ## Serve phpdoc API documentation at http;://localhost:8000
6466
cd $(API_DOCS_PATH) && php -S localhost:8000 && cd ../..
67+
68+
include Makefile.help.mk
69+

Makefile.help.mk

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
.PHONY: help
2+
help: ## Show this help ( default )
3+
@fgrep -h "##" $(MAKEFILE_LIST) | fgrep -v fgrep | sed -e 's/\\$$//' | sed -e 's/##//'
4+
5+
.DEFAULT_GOAL := help

0 commit comments

Comments
 (0)