Skip to content
This repository has been archived by the owner on Oct 8, 2024. It is now read-only.

Commit

Permalink
Merge branch 'ntr/update-analysis-tools' into '6.1'
Browse files Browse the repository at this point in the history
Ntr/update analysis tools

See merge request shopware/6/product/development!128
  • Loading branch information
pweyck committed Feb 7, 2020
2 parents 685f0d4 + 34e4756 commit bd94a7b
Show file tree
Hide file tree
Showing 8 changed files with 226 additions and 278 deletions.
2 changes: 1 addition & 1 deletion dev-ops/analyze/vendor-bin/cs-fixer/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
"require-dev": {
"friendsofphp/php-cs-fixer": "^2.16.1",
"kubawerlos/php-cs-fixer-custom-fixers": "^1.17.0",
"symplify/easy-coding-standard": "^7.2.1"
"symplify/easy-coding-standard": "^7.2.2"
}
}
324 changes: 160 additions & 164 deletions dev-ops/analyze/vendor-bin/cs-fixer/composer.lock

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dev-ops/analyze/vendor-bin/phpstan/composer.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"require-dev": {
"phpstan/extension-installer": "^1.0.3",
"phpstan/phpstan": "^0.12.5",
"phpstan/phpstan": "^0.12.9",
"phpstan/phpstan-phpunit": "^0.12.6",
"phpstan/phpstan-symfony": "^0.12.3"
"phpstan/phpstan-symfony": "^0.12.4"
}
}
74 changes: 11 additions & 63 deletions dev-ops/analyze/vendor-bin/phpstan/composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dev-ops/analyze/vendor-bin/psalm/composer.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"require-dev": {
"vimeo/psalm": "^3.8.2",
"vimeo/psalm": "^3.8.3",
"symfony/expression-language": "^3.3 || ^4.0 || ^5.0"
}
}
59 changes: 29 additions & 30 deletions dev-ops/analyze/vendor-bin/psalm/composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions dev-ops/common/actions/static-analyze.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
#DESCRIPTION: Run static code analysis on core

php dev-ops/analyze/phpstan-config-generator.php
php dev-ops/analyze/vendor/bin/phpstan analyze --autoload-file=dev-ops/analyze/vendor/autoload.php --configuration vendor/shopware/platform/phpstan.neon
php dev-ops/analyze/vendor/bin/psalm --config=vendor/shopware/platform/psalm.xml --threads=4 --show-info=false
php dev-ops/analyze/vendor/bin/phpstan analyze --autoload-file=dev-ops/analyze/vendor/autoload.php --configuration vendor/shopware/platform/phpstan.neon
php dev-ops/analyze/vendor/bin/psalm --config=vendor/shopware/platform/psalm.xml --threads=$(nproc) --diff --show-info=false
35 changes: 20 additions & 15 deletions dev-ops/pre-commit
Original file line number Diff line number Diff line change
Expand Up @@ -45,29 +45,34 @@ fi

if [[ -n "$PHP_FILES" ]]
then
# fix code style and update the commit
if [ -e ${PROJECT_ROOT}/vendor/shopware/platform/easy-coding-standard.yml ]
then
php ${PROJECT_ROOT}/dev-ops/analyze/vendor/bin/ecs check --fix --quiet -vv ${PHP_FILES}
else
php ${PROJECT_ROOT}/dev-ops/analyze/vendor/bin/php-cs-fixer fix --config=.php_cs.dist --quiet -vv ${PHP_FILES}
fi
cd ${PROJECT_ROOT}

for FILE in ${PHP_FILES}
do
php -l -d display_errors=0 "$FILE" 1> /dev/null
echo "Linting"
PHP_FILES_ARRAY=(${PHP_FILES});
for i in "${!PHP_FILES_ARRAY[@]}"; do
PHP_FILES_ARRAY[$i]="platform/"${PHP_FILES_ARRAY[$i]}
php -l -d display_errors=0 ${PHP_FILES_ARRAY[$i]} 1> /dev/null
done

PHP_FILES_FOR_CHECKS=$(printf '%s ' "${PHP_FILES_ARRAY[@]}")

echo "Fix code style"
php dev-ops/analyze/vendor/bin/ecs check --fix --config platform/easy-coding-standard.yml --no-progress-bar --no-error-table ${PHP_FILES_FOR_CHECKS}

echo "Check code with PHPStan"
if [ -z "$(docker-compose ps -q app_server)" ]
then
php ${PROJECT_ROOT}/dev-ops/analyze/phpstan-config-generator.php
php ${PROJECT_ROOT}/dev-ops/analyze/vendor/bin/phpstan analyze --no-progress --configuration ${PROJECT_ROOT}/platform/phpstan.neon --autoload-file="$AUTOLOAD_FILE" ${PHP_FILES}
php dev-ops/analyze/phpstan-config-generator.php
php dev-ops/analyze/vendor/bin/phpstan analyze --no-progress --configuration platform/phpstan.neon --autoload-file="$AUTOLOAD_FILE" ${PHP_FILES_FOR_CHECKS}
else
docker-compose exec -u $(id -u) -T -w /app/platform app_server php /app/dev-ops/analyze/phpstan-config-generator.php
docker-compose exec -u $(id -u) -T -w /app/platform app_server php /app/dev-ops/analyze/vendor/bin/phpstan analyze --no-progress --configuration /app/platform/phpstan.neon --autoload-file="/app/dev-ops/analyze/vendor/autoload.php" ${PHP_FILES}
docker-compose exec -u $(id -u) -T app_server php /app/dev-ops/analyze/phpstan-config-generator.php
docker-compose exec -u $(id -u) -T -w /app app_server php /app/dev-ops/analyze/vendor/bin/phpstan analyze --configuration /app/platform/phpstan.neon --autoload-file="/app/dev-ops/analyze/vendor/autoload.php" ${PHP_FILES_FOR_CHECKS}
fi

php ${PROJECT_ROOT}/dev-ops/analyze/vendor/bin/psalm --config=${PROJECT_ROOT}/vendor/shopware/platform/psalm.xml --threads=2 --show-info=false --root=${PROJECT_ROOT} ${PHP_FILES}
echo "Check code with Psalm"
php ${PROJECT_ROOT}/dev-ops/analyze/vendor/bin/psalm --config=${PROJECT_ROOT}/vendor/shopware/platform/psalm.xml --threads=$(nproc) --diff --show-info=false --root=${PROJECT_ROOT} --no-progress ${PHP_FILES_FOR_CHECKS}

cd ${PLATFORM_ROOT}
fi

if [[ -n "$SCSS_ADMIN_FILES" ]]
Expand Down

0 comments on commit bd94a7b

Please sign in to comment.