diff --git a/build/rules/test-acceptance.mk b/build/rules/test-acceptance.mk index 69a475282bec..a8ecca203f2a 100644 --- a/build/rules/test-acceptance.mk +++ b/build/rules/test-acceptance.mk @@ -9,6 +9,7 @@ acceptance_test_deps=vendor-bin/behat/vendor # bin file definitions BEHAT_BIN=vendor-bin/behat/vendor/bin/behat +PHP_CODESNIFFER=vendor-bin/php_codesniffer/vendor/bin/phpcs .PHONY: test-acceptance-api test-acceptance-api: ## Run API acceptance tests @@ -25,6 +26,11 @@ test-acceptance-webui: ## Run webUI acceptance tests test-acceptance-webui: $(acceptance_test_deps) BEHAT_BIN=$(BEHAT_BIN) ../../tests/acceptance/run.sh --remote --type webui +.PHONY: test-acceptance-style +test-acceptance-style: ## Run php_codesniffer and check acceptance test code-style +test-acceptance-style: vendor-bin/php_codesniffer/vendor + $(PHP_CODESNIFFER) --runtime-set ignore_warnings_on_exit --standard=phpcs.xml tests/acceptance + # # Dependency management #-------------------------------------- @@ -36,3 +42,9 @@ vendor-bin/behat/vendor: vendor/bamarni/composer-bin-plugin vendor-bin/behat/com vendor-bin/behat/composer.lock: vendor-bin/behat/composer.json @echo behat composer.lock is not up to date. + +vendor-bin/php_codesniffer/vendor: vendor/bamarni/composer-bin-plugin vendor-bin/php_codesniffer/composer.lock + composer bin php_codesniffer install --no-progress + +vendor-bin/php_codesniffer/composer.lock: vendor-bin/php_codesniffer/composer.json + @echo php_codesniffer composer.lock is not up to date. diff --git a/build/rules/test-php.mk b/build/rules/test-php.mk index b905d4078eea..e0aaf6f4fb2c 100644 --- a/build/rules/test-php.mk +++ b/build/rules/test-php.mk @@ -9,7 +9,6 @@ include $(RELATIVE_PATH)check-composer.mk PHPUNIT=php -d zend.enable_gc=0 "$(PWD)/../../lib/composer/bin/phpunit" PHPUNITDBG=phpdbg -qrr -d memory_limit=4096M -d zend.enable_gc=0 "$(PWD)/../../lib/composer/bin/phpunit" PHP_CS_FIXER=php -d zend.enable_gc=0 vendor-bin/owncloud-codestyle/vendor/bin/php-cs-fixer -PHP_CODESNIFFER=vendor-bin/php_codesniffer/vendor/bin/phpcs PHAN=php -d zend.enable_gc=0 vendor-bin/phan/vendor/bin/phan PHPSTAN=php -d zend.enable_gc=0 vendor-bin/phpstan/vendor/bin/phpstan @@ -25,9 +24,8 @@ test-php-unit-dbg: .PHONY: test-php-style test-php-style: ## Run php-cs-fixer and check owncloud code-style -test-php-style: vendor-bin/owncloud-codestyle/vendor vendor-bin/php_codesniffer/vendor +test-php-style: vendor-bin/owncloud-codestyle/vendor $(PHP_CS_FIXER) fix -v --diff --diff-format udiff --allow-risky yes --dry-run - $(PHP_CODESNIFFER) --runtime-set ignore_warnings_on_exit --standard=phpcs.xml tests/acceptance .PHONY: test-php-style-fix test-php-style-fix: ## Run php-cs-fixer and fix code style issues @@ -56,12 +54,6 @@ vendor-bin/owncloud-codestyle/vendor: vendor/bamarni/composer-bin-plugin vendor- vendor-bin/owncloud-codestyle/composer.lock: vendor-bin/owncloud-codestyle/composer.json @echo owncloud-codestyle composer.lock is not up to date. -vendor-bin/php_codesniffer/vendor: vendor/bamarni/composer-bin-plugin vendor-bin/php_codesniffer/composer.lock - composer bin php_codesniffer install --no-progress - -vendor-bin/php_codesniffer/composer.lock: vendor-bin/php_codesniffer/composer.json - @echo php_codesniffer composer.lock is not up to date. - vendor-bin/phan/vendor: vendor/bamarni/composer-bin-plugin vendor-bin/phan/composer.lock composer bin phan install --no-progress