Skip to content

Commit 3f80308

Browse files
authored
chore: Tweak the ComposerRootVersionChecker related make commands (#826)
- Rename `update_root_version` and `check_composer_root_version` to respectively `composer_root_version_update` and `composer_root_version_lint`. - Add a `composer_root_version_check` command that runs all the checks (previously `cd composer-root-version-checker; make all`). - Rename ComposerRootVersionChecker make `all` command to `check` for consistency. - Had to fiddle around with the order in order to satisfy some make variables being undefined.
1 parent 911e16d commit 3f80308

File tree

3 files changed

+25
-20
lines changed

3 files changed

+25
-20
lines changed

Makefile

Lines changed: 17 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
MAKEFLAGS += --warn-undefined-variables
33
MAKEFLAGS += --no-builtin-rules
44

5-
include .makefile/e2e.file
6-
75
SRC_FILES := $(shell find bin/ src/ vendor-hotfix/ -type f)
86

97
PHP_SCOPER_PHAR_BIN = bin/php-scoper.phar
@@ -50,18 +48,13 @@ help:
5048

5149
.PHONY: check
5250
check: ## Runs all checks
53-
check: update_root_version cs composer_normalize phpstan test
51+
check: composer_root_version_lint cs composer_normalize phpstan test
5452

5553
.PHONY: clean
5654
clean: ## Cleans all created artifacts
5755
clean:
5856
git clean --exclude=.idea/ -ffdx
5957

60-
update_root_version: ## Checks the latest GitHub release and update COMPOSER_ROOT_VERSION accordingly
61-
update_root_version:
62-
rm .composer-root-version || true
63-
$(MAKE) .composer-root-version
64-
6558
.PHONY: cs
6659
cs: ## Fixes CS
6760
cs: gitignore_sort composer_normalize php_cs_fixer
@@ -106,25 +99,30 @@ outdated_fixtures: ## Reports outdated dependencies
10699
outdated_fixtures:
107100
find fixtures -name 'composer.json' -type f -depth 2 -exec dirname '{}' \; | xargs -I % sh -c 'echo "Checking %;" $$(composer install --working-dir=% --ansi && composer outdated --direct --working-dir=% --ansi)'
108101

109-
110-
#
111-
# Tests
112-
#---------------------------------------------------------------------------
113-
114102
.PHONY: test
115103
test: ## Runs all the tests
116-
test: check_composer_root_version validate_package covers_validator phpunit e2e
104+
test: validate_package covers_validator phpunit e2e
117105

118106
.PHONY: validate_package
119107
validate_package: ## Validates the composer.json
120108
validate_package:
121109
composer validate --strict
122110

123-
.PHONY: check_composer_root_version
124-
check_composer_root_version: ## Checks that the COMPOSER_ROOT_VERSION is up to date
125-
check_composer_root_version: .composer-root-version
111+
.PHONY: composer_root_version_check
112+
composer_root_version_check: ## Runs all checks for the ComposerRootVersion app
113+
cd composer-root-version-checker; $(MAKE) --file Makefile check
114+
115+
.PHONY: composer_root_version_lint
116+
composer_root_version_lint: ## Checks that the COMPOSER_ROOT_VERSION is up to date
117+
composer_root_version_lint: .composer-root-version
126118
cd composer-root-version-checker; $(MAKE) --makefile Makefile check_root_version
127119

120+
.PHONY: composer_root_version_update
121+
composer_root_version_update: ## Updates the COMPOSER_ROOT_VERSION
122+
composer_root_version_update:
123+
rm .composer-root-version || true
124+
$(MAKE) .composer-root-version
125+
128126
.PHONY: covers_validator
129127
covers_validator: ## Checks PHPUnit @coves tag
130128
covers_validator: $(COVERS_VALIDATOR_BIN)
@@ -158,6 +156,7 @@ blackfire: vendor
158156
@echo "This might take a while (~2min)"
159157
$(BLACKFIRE) run php bin/php-scoper add-prefix --output-dir=build/php-scoper --force --quiet
160158

159+
include .makefile/e2e.file
161160
.PHONY: e2e
162161
e2e: ## Runs end-to-end tests
163162
e2e: e2e_004 e2e_005 e2e_011 e2e_013 e2e_014 e2e_015 e2e_016 e2e_017 e2e_018 e2e_019 e2e_020 e2e_024 e2e_025 e2e_027 e2e_028 e2e_029 e2e_030 e2e_031 e2e_032 e2e_033 e2e_034 e2e_035
@@ -239,7 +238,7 @@ vendor-bin/phpstan/composer.lock: vendor-bin/phpstan/composer.json
239238
@echo "$(@) is not up to date. You may want to run the following command:"
240239
@echo "$$ composer bin phpstan update --lock && touch -c $(@)"
241240

242-
$(PHP_SCOPER_PHAR_BIN): $(BOX) bin/php-scoper $(SRC_FILES) vendor-hotfix vendor scoper.inc.php box.json.dist
241+
$(PHP_SCOPER_PHAR_BIN): $(BOX) bin/php-scoper $(SRC_FILES) vendor scoper.inc.php box.json.dist
243242
$(BOX) compile --no-parallel
244243
touch -c $@
245244

composer-root-version-checker/Makefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@ help:
1616
@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}'
1717

1818

19-
all: cs cs_lint check_root_version phpunit
19+
.PHONY: check
20+
check: cs cs_lint check_root_version phpunit
2021

2122

2223
.PHONY: check_root_version

composer-root-version-checker/src/Checker.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,12 @@ public static function check(): int
5353
$currentRootVersion = RootVersionProvider::provideCurrentVersion();
5454

5555
if ($expectedComposerRootVersion === $currentRootVersion) {
56-
$logger->notice('The tag is up to date.');
56+
$logger->notice(
57+
sprintf(
58+
'The tag is up to date (%s).',
59+
$currentRootVersion,
60+
),
61+
);
5762

5863
return 0;
5964
}

0 commit comments

Comments
 (0)