-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
41 lines (34 loc) · 991 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
30
31
32
33
34
35
36
37
38
39
40
41
SHELL = /bin/bash
.DEFAULT_GOAL := all
HERE := $(dir $(realpath $(firstword $(MAKEFILE_LIST))))
# https://mwop.net/blog/2023-12-11-advent-makefile.html
##@ Help
help: ## Display this help
@awk 'BEGIN {FS = ":.*##"; printf "\nUsage:\n make \033[36m<target>\033[0m\n"} /^[0-9a-zA-Z_-]+:.*?##/ { printf " \033[36m%-15s\033[0m %s\n", $$1, $$2 } /^##@/ { printf "\n\033[1m%s\033[0m\n", substr($$0, 5) } ' $(MAKEFILE_LIST)
.PHONY: all
all: style lint analyze tests ## <default> Do everything
# ### #
.PHONY: style
style: ## Fix any style issues
@echo
@echo "--> Style: php-cs-fixer"
vendor/bin/php-cs-fixer fix -v
@echo
.PHONY: lint
lint: ## Check if the code is valid
@echo
@echo "--> Lint"
php -l src/josephscott/phpcsfixer-config.php
@echo
.PHONY: analyze
analyze: ## Static analysis, catch problems in code
@echo
@echo "--> Analyze: phpstan"
vendor/bin/phpstan
@echo
.PHONY: tests
tests: ## Pest tests
@echo
@echo "--> Tests: Pest"
bash -c "./vendor/bin/pest"
@echo