From 1452bbaf0fa0dfb908cdb7223919e962b282edb3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Th=C3=A9o=20FIDRY?= <5175937+theofidry@users.noreply.github.com> Date: Sat, 7 Jan 2023 11:11:53 +0100 Subject: [PATCH] chore: Add requirement checker make commands to the root Makefile (#758) --- Makefile | 26 ++++++++++++++++++++------ tests/MakefileTest.php | 2 +- 2 files changed, 21 insertions(+), 7 deletions(-) diff --git a/Makefile b/Makefile index 72bcb7cb1..a1ab1c993 100644 --- a/Makefile +++ b/Makefile @@ -20,7 +20,7 @@ REQUIREMENT_CHECKER_EXTRACT = res/requirement-checker .PHONY: help help: - @echo "\033[33mUsage:\033[0m\n make TARGET\n\n\033[32m#\n# Commands\n#---------------------------------------------------------------------------\033[0m\n" + @printf "\033[33mUsage:\033[0m\n make TARGET\n\n\033[32m#\n# Commands\n#---------------------------------------------------------------------------\033[0m\n\n" @fgrep -h "##" $(MAKEFILE_LIST) | fgrep -v fgrep | sed -e 's/\\$$//' | sed -e 's/##//' | awk 'BEGIN {FS = ":"}; {printf "\033[33m%s:\033[0m%s\n", $$1, $$2}' @@ -35,11 +35,25 @@ clean: .PHONY: cs cs: ## Fixes CS -cs: gitignore_sort composer_normalize php_cs_fixer +cs: root_cs requirement_checker_cs + +.PHONY: root_cs +root_cs: gitignore_sort composer_normalize php_cs_fixer + +.PHONY: requirement_checker_cs +requirement_checker_cs: + cd requirement-checker; $(MAKE) --file=Make cs .PHONY: cs_lint cs_lint: ## Checks CS -cs_lint: composer_normalize_lint php_cs_fixer_lint +cs_lint: root_cs_lint requirement_checker_cs_lint + +.PHONY: root_cs_lint +root_cs_lint: composer_normalize_lint php_cs_fixer_lint + +.PHONY: requirement_checker_cs_lint +requirement_checker_cs_lint: + cd requirement-checker; $(MAKE) --file=Make cs_lint .PHONY: php_cs_fixer php_cs_fixer: $(PHP_CS_FIXER_BIN) @@ -66,9 +80,9 @@ compile: ## Compiles the application into the PHAR compile: box cp -f box bin/box.phar -.PHONY: dump-requirement-checker -dump-requirement-checker:## Dumps the requirement checker -dump-requirement-checker: +.PHONY: dump_requirement_checker +dump_requirement_checker:## Dumps the requirement checker +dump_requirement_checker: cd requirement-checker; $(MAKE) --file=Makefile dump diff --git a/tests/MakefileTest.php b/tests/MakefileTest.php index 608f483a9..77f9e7b2b 100644 --- a/tests/MakefileTest.php +++ b/tests/MakefileTest.php @@ -40,7 +40,7 @@ protected function getExpectedHelpOutput(): string cs: Fixes CS cs_lint: Checks CS compile: Compiles the application into the PHAR - dump-requirement-checker: Dumps the requirement checker + dump_requirement_checker: Dumps the requirement checker test: Runs all the tests tu: Runs the unit tests tu_box: Runs the unit tests