-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathMakefile
More file actions
55 lines (41 loc) · 1.25 KB
/
Copy pathMakefile
File metadata and controls
55 lines (41 loc) · 1.25 KB
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
49
50
51
52
53
54
55
COMPOSER ?= composer
.DEFAULT_GOAL := all
.PHONY: all
all: install test ## Install dependencies and run the full suite
.PHONY: install
install: ## Install dependencies
$(COMPOSER) install --no-interaction
.PHONY: update
update: ## Update dependencies and refresh the lock file
$(COMPOSER) update --no-interaction
.PHONY: test
test: ## Run every quality gate
$(COMPOSER) test
.PHONY: phpcs
phpcs: ## Check coding standard
$(COMPOSER) phpcs
.PHONY: phpcbf
phpcbf: ## Fix what the coding standard can fix automatically
$(COMPOSER) phpcbf
.PHONY: phpmd
phpmd: ## Check cyclomatic complexity
$(COMPOSER) phpmd
.PHONY: phpstan
phpstan: ## Run static analysis
$(COMPOSER) phpstan
.PHONY: phpunit
phpunit: ## Run the tests with coverage
$(COMPOSER) phpunit
.PHONY: audit
audit: ## Check the lock file for known advisories
$(COMPOSER) audit --locked
.PHONY: example
example: install ## Run the usage example
php example.php
.PHONY: clean
clean: ## Remove installed dependencies and build artifacts
rm -rf vendor .phpunit.cache .phpunit.result.cache .phpcs.cache clover.xml
.PHONY: help
help: ## List the available targets
@grep -hE '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) \
| awk 'BEGIN {FS = ":.*?## "}; {printf " \033[36m%-10s\033[0m %s\n", $$1, $$2}'