aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorn-peugnet <n.peugnet@free.fr>2020-12-19 19:52:59 +0100
committern-peugnet <n.peugnet@free.fr>2020-12-19 19:52:59 +0100
commitd2bbcab233dabe3b04f8c3b94a947ec174540418 (patch)
tree8ed06c1b412cc20f899686738a49bef6b1ead7d8 /Makefile
parent9338d030f38b465be5f6307f5ee6f2e20d904856 (diff)
downloadwcms-d2bbcab233dabe3b04f8c3b94a947ec174540418.tar.gz
wcms-d2bbcab233dabe3b04f8c3b94a947ec174540418.zip
run phpcbf and add fix target to Makefile
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile8
1 files changed, 7 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index e3fc1ad..8f4ca9d 100644
--- a/Makefile
+++ b/Makefile
@@ -135,6 +135,7 @@ endif
vendor: composer.json composer.lock
@echo Installing PHP dependencies...
composer install $(COMPOSER_FLAGS)
+ touch $@
# Install JS dependencies.
node_modules: package.json package-lock.json
@@ -170,7 +171,12 @@ check: vendor lint analyse test
# Lint php code with phpcs.
.PHONY: lint
lint: $(phpcs_dir)
- phpcs --report-full --report-summary --cache=$(phpcs_dir)/result.cache
+ phpcs --report-full --report-summary --cache=$(phpcs_dir)/result.cache || printf "run 'make fix'\n\n"; exit 1
+
+# fix php code with phpcbf.
+.PHONY: fix
+fix: $(phpcs_dir)
+ phpcbf || exit 0
# Analyse php code with phpstan.
.PHONY: analyse