forked from contributte/czech-post
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
29 lines (19 loc) · 870 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
.PHONY: qa lint cs csf phpstan tests coverage
all:
@awk 'BEGIN {FS = ":.*##"; printf "Usage:\n make \033[36m<target>\033[0m\n\nTargets:\n"}'
@grep -h -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf " \033[36m%-20s\033[0m %s\n", $$1, $$2}'
# QA
qa: lint phpstan cs ## Check code quality - coding style and static analysis
lint: ## Check PHP files syntax
vendor/bin/linter src tests
cs: ## Check PHP files coding style
vendor/bin/codesniffer src tests
csf: ## Fix PHP files coding style
vendor/bin/codefixer src tests
phpstan: ## Analyse code with PHPStan
vendor/bin/phpstan analyse -l max -c phpstan.neon src
# Tests
tests: ## Run all tests
vendor/bin/phpunit tests --colors=always
coverage: ## Generate code coverage in XML format
phpdbg -qrr vendor/bin/phpunit tests --colors=always -c tests/coverage.xml