Skip to content

Commit

Permalink
Add missing and improve readability of .PHONY declarations for Makefi…
Browse files Browse the repository at this point in the history
  • Loading branch information
nlisgo committed Jan 30, 2025
1 parent bc66d9a commit 4dd4ac6
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,28 +1,34 @@
PROJECT_NAME = patterns-php
.PHONY: build lint phpcs test test-ci update-pattern-library

vendor:
composer install

.PHONY: test
test: vendor
vendor/bin/phpunit

.PHONY: phpcs
phpcs:
vendor/bin/phpcs --standard=phpcs.xml.dist --warning-severity=0 -p bin src tests

.PHONY: lint
lint: phpcs
find src tests -name '*.php' | xargs -L1 php -l

.PHONY: update-pattern-library
update-pattern-library:
bin/update

.PHONY: build
build:
$(if $(PHP_VERSION),,$(error PHP_VERSION make variable needs to be set))
docker buildx build --build-arg=PHP_VERSION=$(PHP_VERSION) -t $(PROJECT_NAME):$(PHP_VERSION) .

.PHONY: lint-ci
lint-ci: build
docker run --rm $(PROJECT_NAME):$(PHP_VERSION) bash -c 'vendor/bin/phpcs --standard=phpcs.xml.dist --warning-severity=0 -p bin src tests'
docker run --rm $(PROJECT_NAME):$(PHP_VERSION) bash -c 'find src tests -name '*.php' | xargs -L1 php -l'

.PHONY: test-ci
test-ci: build
docker run --rm $(PROJECT_NAME):$(PHP_VERSION) bash -c 'vendor/bin/phpunit'

0 comments on commit 4dd4ac6

Please sign in to comment.