From a6b4365542110431af7d9e7812305a4cb010c8af Mon Sep 17 00:00:00 2001 From: fedy95 Date: Thu, 28 Jan 2021 18:39:26 +0300 Subject: [PATCH] add-linters --- composer.json | 65 ++++++++++++++++++++++++++++++++++++++++----------- composer.lock | 65 +++++++++++++++++++++++++++++++++++++++++++++++---- symfony.lock | 3 +++ 3 files changed, 115 insertions(+), 18 deletions(-) diff --git a/composer.json b/composer.json index 5e9a9aa..3fd251d 100644 --- a/composer.json +++ b/composer.json @@ -21,10 +21,11 @@ "codeception/codeception": "^4.1", "codeception/module-asserts": "^1.3", "codeception/module-phpbrowser": "^1.0", + "codeception/module-rest": "^1.2", "ergebnis/composer-normalize": "^2.13", "friendsofphp/php-cs-fixer": "^2.18", - "roave/security-advisories": "dev-master", - "codeception/module-rest": "^1.2" + "php-parallel-lint/php-parallel-lint": "^1.2", + "roave/security-advisories": "dev-master" }, "config": { "apcu-autoloader": true, @@ -33,7 +34,8 @@ "optimize-autoloader": true, "preferred-install": { "*": "dist" - } + }, + "sort-packages": true }, "extra": { "composer-normalize": { @@ -71,33 +73,68 @@ "assets:install %PUBLIC_DIR%": "symfony-cmd" }, "codecept": "codecept -c tests/codeception.yml", + "json-cs-fix": "composer normalize", + "lint:php": [ + "parallel-lint --no-progress --no-colors --blame ./bin/console", + "parallel-lint --no-progress --no-colors --blame ./config/bundles.php", + "parallel-lint --no-progress --no-colors --blame ./config/preload.php", + "parallel-lint --no-progress --no-colors --blame ./public/index.php", + "parallel-lint --no-progress --no-colors --blame ./src", + "parallel-lint --no-progress --no-colors --blame ./tests/_support/Helper", + "parallel-lint --no-progress --no-colors --blame ./tests/_support/AcceptanceTester.php", + "parallel-lint --no-progress --no-colors --blame ./tests/_support/ApiTester.php", + "parallel-lint --no-progress --no-colors --blame ./tests/_support/UnitTester.php", + "parallel-lint --no-progress --no-colors --blame ./tests/acceptance", + "parallel-lint --no-progress --no-colors --blame ./tests/api", + "parallel-lint --no-progress --no-colors --blame ./tests/unit", + "parallel-lint --no-progress --no-colors --blame ./.php_cs" + ], + "lint:yaml": [ + "bin/console --quiet --no-debug l:yaml ./config/packages", + "bin/console --quiet --no-debug l:yaml ./config/routes", + "bin/console --quiet --no-debug l:yaml ./config/routes.yaml", + "bin/console --quiet --no-debug l:yaml ./config/services.yaml", + "bin/console --quiet --no-debug l:yaml ./tests/acceptance.suite.yml", + "bin/console --quiet --no-debug l:yaml ./tests/api.suite.yml", + "bin/console --quiet --no-debug l:yaml ./tests/codeception.yml", + "bin/console --quiet --no-debug l:yaml ./tests/unit.suite.yml" + ], "php-cs-fix": [ "php vendor/bin/php-cs-fixer fix --cache-file=var/php-cs-fixer/.php-cs.cache bin/console", "php vendor/bin/php-cs-fixer fix --cache-file=var/php-cs-fixer/.php-cs.cache config/bundles.php", "php vendor/bin/php-cs-fixer fix --cache-file=var/php-cs-fixer/.php-cs.cache config/preload.php", "php vendor/bin/php-cs-fixer fix --cache-file=var/php-cs-fixer/.php-cs.cache public/index.php", "php vendor/bin/php-cs-fixer fix --cache-file=var/php-cs-fixer/.php-cs.cache src", - "php vendor/bin/php-cs-fixer fix --cache-file=var/php-cs-fixer/.php-cs.cache tests", + "php vendor/bin/php-cs-fixer fix --cache-file=var/php-cs-fixer/.php-cs.cache tests/_support/Helper", + "php vendor/bin/php-cs-fixer fix --cache-file=var/php-cs-fixer/.php-cs.cache tests/_support/AcceptanceTester.php", + "php vendor/bin/php-cs-fixer fix --cache-file=var/php-cs-fixer/.php-cs.cache tests/_support/ApiTester.php", + "php vendor/bin/php-cs-fixer fix --cache-file=var/php-cs-fixer/.php-cs.cache tests/_support/UnitTester.php", + "php vendor/bin/php-cs-fixer fix --cache-file=var/php-cs-fixer/.php-cs.cache tests/acceptance", + "php vendor/bin/php-cs-fixer fix --cache-file=var/php-cs-fixer/.php-cs.cache tests/api", + "php vendor/bin/php-cs-fixer fix --cache-file=var/php-cs-fixer/.php-cs.cache tests/unit", "php vendor/bin/php-cs-fixer fix --cache-file=var/php-cs-fixer/.php-cs.cache .php_cs" ], - "test:api": [ - "@codecept build -q", - "@codecept run api" + "prepare-request": [ + "@json-cs-fix", + "@lint:yaml", + "@lint:php", + "@lint:container", + "@php-cs-fix", + "@test:unit", + "@test:api", + "@test:acceptance" ], "test:acceptance": [ "@codecept build -q", "@codecept run acceptance" ], + "test:api": [ + "@codecept build -q", + "@codecept run api" + ], "test:unit": [ "@codecept build -q", "@codecept run unit --no-rebuild --coverage-html --coverage-text --no-colors" - ], - "prepare": [ - "@json-cs-fix", - "@php-cs-fix", - "@test:unit", - "@test:api", - "@test:acceptance" ] } } diff --git a/composer.lock b/composer.lock index 956aec8..940fed2 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "f0a8d27758152f19c0d1f1fbc37ba87e", + "content-hash": "6a8bd6e7067476da729289b79de15fc5", "packages": [ { "name": "psr/cache", @@ -4373,6 +4373,63 @@ }, "time": "2020-10-14T08:39:05+00:00" }, + { + "name": "php-parallel-lint/php-parallel-lint", + "version": "v1.2.0", + "source": { + "type": "git", + "url": "https://github.com/php-parallel-lint/PHP-Parallel-Lint.git", + "reference": "474f18bc6cc6aca61ca40bfab55139de614e51ca" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-parallel-lint/PHP-Parallel-Lint/zipball/474f18bc6cc6aca61ca40bfab55139de614e51ca", + "reference": "474f18bc6cc6aca61ca40bfab55139de614e51ca", + "shasum": "" + }, + "require": { + "ext-json": "*", + "php": ">=5.4.0" + }, + "replace": { + "grogy/php-parallel-lint": "*", + "jakub-onderka/php-parallel-lint": "*" + }, + "require-dev": { + "nette/tester": "^1.3 || ^2.0", + "php-parallel-lint/php-console-highlighter": "~0.3", + "squizlabs/php_codesniffer": "~3.0" + }, + "suggest": { + "php-parallel-lint/php-console-highlighter": "Highlight syntax in code snippet" + }, + "bin": [ + "parallel-lint" + ], + "type": "library", + "autoload": { + "classmap": [ + "./" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-2-Clause" + ], + "authors": [ + { + "name": "Jakub Onderka", + "email": "ahoj@jakubonderka.cz" + } + ], + "description": "This tool check syntax of PHP files about 20x faster than serial check.", + "homepage": "https://github.com/php-parallel-lint/PHP-Parallel-Lint", + "support": { + "issues": "https://github.com/php-parallel-lint/PHP-Parallel-Lint/issues", + "source": "https://github.com/php-parallel-lint/PHP-Parallel-Lint/tree/master" + }, + "time": "2020-04-04T12:18:32+00:00" + }, { "name": "phpdocumentor/reflection-common", "version": "2.2.0", @@ -7105,9 +7162,9 @@ "prefer-lowest": false, "platform": { "php": "7.4.*", - "ext-apcu": "^5.1", - "ext-ctype": "*", - "ext-iconv": "*" + "ext-apcu": "5.1.*", + "ext-ctype": "7.4.*", + "ext-iconv": "7.4.*" }, "platform-dev": [], "plugin-api-version": "2.0.0" diff --git a/symfony.lock b/symfony.lock index e2f1438..c464779 100644 --- a/symfony.lock +++ b/symfony.lock @@ -125,6 +125,9 @@ "php-cs-fixer/diff": { "version": "v1.3.1" }, + "php-parallel-lint/php-parallel-lint": { + "version": "v1.2.0" + }, "phpdocumentor/reflection-common": { "version": "2.2.0" },