From 2ed8c7f3d2a2363d9a15dc3739859cd869d15403 Mon Sep 17 00:00:00 2001 From: Markus Staab Date: Mon, 2 Dec 2024 20:32:29 +0100 Subject: [PATCH] Added lint in github actions --- .github/workflows/continuous-integration.yml | 5 ++ composer.json | 4 +- generator/composer.json | 6 +- generator/composer.lock | 76 ++++++++++++++++++-- 4 files changed, 82 insertions(+), 9 deletions(-) diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index 6fb01644..9efb8914 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -81,6 +81,9 @@ jobs: - name: "Run coding standard checks with squizlabs/php_codesniffer in generator/ directory" run: "composer cs-check" working-directory: "generator" + - name: "lint generator/ directory" + run: "composer lint" + working-directory: "generator" - name: "Run static code analysis with phpstan/phpstan in generator/ directory" run: "composer phpstan" working-directory: "generator" @@ -125,6 +128,8 @@ jobs: run: "composer dump-autoload" - name: "Run coding standard checks with squizlabs/php_codesniffer in root directory" run: "composer cs-check" + - name: "lint in root directory" + run: "composer lint" - name: "Run static code analysis with phpstan/phpstan in root directory" run: "composer phpstan" diff --git a/composer.json b/composer.json index cb78de5b..3fd69823 100644 --- a/composer.json +++ b/composer.json @@ -108,9 +108,11 @@ "phpstan/phpstan": "^1", "thecodingmachine/phpstan-strict-rules": "^1.0", "squizlabs/php_codesniffer": "^3.2", - "phpunit/phpunit": "^10" + "phpunit/phpunit": "^10", + "php-parallel-lint/php-parallel-lint": "^1.4" }, "scripts": { + "lint": "parallel-lint deprecated/ lib/ tests/", "test": "phpunit", "phpstan": "phpstan analyse", "cs-fix": "phpcbf", diff --git a/generator/composer.json b/generator/composer.json index 482f613d..67903233 100644 --- a/generator/composer.json +++ b/generator/composer.json @@ -19,10 +19,12 @@ "thecodingmachine/phpstan-strict-rules": "^1.0", "squizlabs/php_codesniffer": "^3.2", "php-coveralls/php-coveralls": "^2.1", - "phpstan/phpstan": "^1" + "phpstan/phpstan": "^1", + "php-parallel-lint/php-parallel-lint": "^1.4" }, "scripts": { - "test": "vendor/bin/phpunit", + "lint": "parallel-lint config/ src/ tests/", + "test": "phpunit", "phpstan": "phpstan analyse", "cs-fix": "phpcbf", "cs-check": "phpcs" diff --git a/generator/composer.lock b/generator/composer.lock index 61f3e2d1..29f334be 100644 --- a/generator/composer.lock +++ b/generator/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": "44db46e0c8f9d8ef84ceee2981866173", + "content-hash": "0cc307c91458e570fc796a3ec8c62614", "packages": [ { "name": "psr/container", @@ -1478,18 +1478,79 @@ }, "time": "2023-11-22T10:21:01+00:00" }, + { + "name": "php-parallel-lint/php-parallel-lint", + "version": "v1.4.0", + "source": { + "type": "git", + "url": "https://github.com/php-parallel-lint/PHP-Parallel-Lint.git", + "reference": "6db563514f27e19595a19f45a4bf757b6401194e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-parallel-lint/PHP-Parallel-Lint/zipball/6db563514f27e19595a19f45a4bf757b6401194e", + "reference": "6db563514f27e19595a19f45a4bf757b6401194e", + "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 checks the syntax of PHP files about 20x faster than serial check.", + "homepage": "https://github.com/php-parallel-lint/PHP-Parallel-Lint", + "keywords": [ + "lint", + "static analysis" + ], + "support": { + "issues": "https://github.com/php-parallel-lint/PHP-Parallel-Lint/issues", + "source": "https://github.com/php-parallel-lint/PHP-Parallel-Lint/tree/v1.4.0" + }, + "time": "2024-03-27T12:14:49+00:00" + }, { "name": "phpstan/phpstan", - "version": "1.12.11", + "version": "1.12.12", "source": { "type": "git", "url": "https://github.com/phpstan/phpstan.git", - "reference": "0d1fc20a962a91be578bcfe7cf939e6e1a2ff733" + "reference": "b5ae1b88f471d3fd4ba1aa0046234b5ca3776dd0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan/zipball/0d1fc20a962a91be578bcfe7cf939e6e1a2ff733", - "reference": "0d1fc20a962a91be578bcfe7cf939e6e1a2ff733", + "url": "https://api.github.com/repos/phpstan/phpstan/zipball/b5ae1b88f471d3fd4ba1aa0046234b5ca3776dd0", + "reference": "b5ae1b88f471d3fd4ba1aa0046234b5ca3776dd0", "shasum": "" }, "require": { @@ -1534,7 +1595,7 @@ "type": "github" } ], - "time": "2024-11-17T14:08:01+00:00" + "time": "2024-11-28T22:13:23+00:00" }, { "name": "phpunit/php-code-coverage", @@ -3600,5 +3661,8 @@ "ext-json": "*" }, "platform-dev": {}, + "platform-overrides": { + "php": "8.1.31" + }, "plugin-api-version": "2.6.0" }