From 37237b32b56bc4341181270de8b05c9dcdeb692c Mon Sep 17 00:00:00 2001 From: Philipp Date: Mon, 5 Apr 2021 19:02:55 +0200 Subject: [PATCH 1/2] Remove php-parallel-lint --- .github/workflows/php.yml | 3 --- composer.json | 1 - composer.lock | 55 +-------------------------------------- 3 files changed, 1 insertion(+), 58 deletions(-) diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml index 0a6341a90..1f3c51812 100644 --- a/.github/workflows/php.yml +++ b/.github/workflows/php.yml @@ -82,9 +82,6 @@ jobs: run: | mysql -h"127.0.0.1" -P"$PORT" -utest -ptest test < database.sql - - name: Test with Parallel-lint - run: vendor/bin/parallel-lint --exclude vendor/ --exclude view/asset/ . - - name: Test with phpunit run: $(git rev-parse --show-toplevel)/bin/phpunit --configuration tests/phpunit.xml --coverage-clover clover.xml env: diff --git a/composer.json b/composer.json index 5d6c71ee3..569c304d5 100644 --- a/composer.json +++ b/composer.json @@ -124,7 +124,6 @@ ] }, "require-dev": { - "php-parallel-lint/php-parallel-lint": "^1.2", "mockery/mockery": "^1.3", "mikey179/vfsstream": "^1.6" }, diff --git a/composer.lock b/composer.lock index f7c709688..7fa535c5e 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": "355e17099c031793ea039e702acbb0d7", + "content-hash": "5cf680863afa011d3c2c9f4e0b817690", "packages": [ { "name": "asika/simple-console", @@ -3978,59 +3978,6 @@ "testing" ], "time": "2021-02-24T09:51:00+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", - "time": "2020-04-04T12:18:32+00:00" } ], "aliases": [], From a14888c96453d2fae09ded7fbfe8324924468165 Mon Sep 17 00:00:00 2001 From: Philipp Date: Mon, 5 Apr 2021 19:07:54 +0200 Subject: [PATCH 2/2] Add native php linting into CI --- .github/workflows/lint.yml | 20 ++++++++++++++++++++ composer.json | 3 ++- 2 files changed, 22 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/lint.yml diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 000000000..3fb324beb --- /dev/null +++ b/.github/workflows/lint.yml @@ -0,0 +1,20 @@ +name: Lint +on: pull_request + +jobs: + php-linters: + runs-on: ubuntu-latest + strategy: + matrix: + php-versions: ['7.3', '7.4', '8.0'] + name: php${{ matrix.php-versions }} lint + steps: + - name: Checkout + uses: actions/checkout@master + - name: Set up php${{ matrix.php-versions }} + uses: shivammathur/setup-php@master + with: + php-version: ${{ matrix.php-versions }} + coverage: none + - name: Lint + run: bin/composer.phar run lint diff --git a/composer.json b/composer.json index 569c304d5..f2e780a1a 100644 --- a/composer.json +++ b/composer.json @@ -128,6 +128,7 @@ "mikey179/vfsstream": "^1.6" }, "scripts": { - "test": "phpunit" + "test": "phpunit", + "lint": "find . -name \\*.php -not -path './vendor/*' -not -path './view/asset/*' -print0 | xargs -0 -n1 php -l" } }