From 868b4b0347635c54a87ab2072e01c1c2141249b5 Mon Sep 17 00:00:00 2001 From: Anupam Kumar Date: Thu, 1 Feb 2024 19:06:22 +0530 Subject: [PATCH] use php parallel lint Signed-off-by: Anupam Kumar --- .github/workflows/lint-php.yml | 4 +++ composer.json | 5 +-- composer.lock | 59 +++++++++++++++++++++++++++++++++- 3 files changed, 65 insertions(+), 3 deletions(-) diff --git a/.github/workflows/lint-php.yml b/.github/workflows/lint-php.yml index b039b9a..8da6c9a 100644 --- a/.github/workflows/lint-php.yml +++ b/.github/workflows/lint-php.yml @@ -64,6 +64,10 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: Composer setup + working-directory: apps/${{ env.APP_NAME }} + run: composer i + - name: Lint run: composer run lint diff --git a/composer.json b/composer.json index a88e5da..47f69b7 100644 --- a/composer.json +++ b/composer.json @@ -26,10 +26,11 @@ "roave/security-advisories": "dev-latest", "phpunit/phpunit": "^9.6", "psalm/phar": "^5.15", - "friendsofphp/php-cs-fixer": "3.38" + "friendsofphp/php-cs-fixer": "3.38", + "php-parallel-lint/php-parallel-lint": "^1.3" }, "scripts": { - "lint": "find . -name \\*.php -not -path './vendor/*' -print0 | xargs -0 -n1 php -l", + "lint": "parallel-lint --exclude vendor .", "cs:check": "php-cs-fixer fix --dry-run --diff", "cs:fix": "php-cs-fixer fix", "psalm": "psalm.phar --threads=1", diff --git a/composer.lock b/composer.lock index 928856a..f5366f6 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": "d14cc787257d1330ec3946fddb768a4a", + "content-hash": "9180886df562cf2c46c68b8ea82caa15", "packages": [], "packages-dev": [ { @@ -443,6 +443,63 @@ }, "time": "2023-11-07T08:45:37+00:00" }, + { + "name": "php-parallel-lint/php-parallel-lint", + "version": "v1.3.2", + "source": { + "type": "git", + "url": "https://github.com/php-parallel-lint/PHP-Parallel-Lint.git", + "reference": "6483c9832e71973ed29cf71bd6b3f4fde438a9de" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-parallel-lint/PHP-Parallel-Lint/zipball/6483c9832e71973ed29cf71bd6b3f4fde438a9de", + "reference": "6483c9832e71973ed29cf71bd6b3f4fde438a9de", + "shasum": "" + }, + "require": { + "ext-json": "*", + "php": ">=5.3.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.* || ^1.0", + "squizlabs/php_codesniffer": "^3.6" + }, + "suggest": { + "php-parallel-lint/php-console-highlighter": "Highlight syntax in code snippet" + }, + "bin": [ + "parallel-lint" + ], + "type": "library", + "autoload": { + "classmap": [ + "./src/" + ] + }, + "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/v1.3.2" + }, + "time": "2022-02-21T12:50:22+00:00" + }, { "name": "phpunit/php-code-coverage", "version": "9.2.30",