From 27fc506dcfa5b97b350f668feae56257def8cd68 Mon Sep 17 00:00:00 2001 From: nupplaPhil Date: Mon, 10 Feb 2020 00:55:17 +0100 Subject: [PATCH] Add lint check in travis-ci --- .travis.yml | 4 +- composer.json | 3 +- composer.lock | 63 ++++++++++++++++++++++--- tests/src/Console/ConfigConsoleTest.php | 2 + 4 files changed, 63 insertions(+), 9 deletions(-) diff --git a/.travis.yml b/.travis.yml index e306787ff1..c3d0092015 100644 --- a/.travis.yml +++ b/.travis.yml @@ -24,6 +24,8 @@ before_script: - phpenv config-add .travis/redis.ini - phpenv config-add .travis/memcached.ini -script: vendor/bin/phpunit --configuration tests/phpunit.xml --coverage-clover clover.xml +script: + - vendor/bin/parallel-lint --exclude vendor/ --exclude view/asset/ . + - vendor/bin/phpunit --configuration tests/phpunit.xml --coverage-clover clover.xml after_success: bash <(curl -s https://codecov.io/bash) diff --git a/composer.json b/composer.json index 915c2b08cc..ae32d90d14 100644 --- a/composer.json +++ b/composer.json @@ -120,7 +120,8 @@ "phpunit/php-token-stream": "^1.4.2", "mikey179/vfsstream": "^1.6", "mockery/mockery": "^1.2", - "johnkary/phpunit-speedtrap": "1.1" + "johnkary/phpunit-speedtrap": "1.1", + "jakub-onderka/php-parallel-lint": "^1.0" }, "scripts": { "test": "phpunit" diff --git a/composer.lock b/composer.lock index 870b06bde0..8834f3f701 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": "1c842fcbaa6de13e4c4f843a4596d7c0", + "content-hash": "e1a839b13f7ba5892c8730d0da3ddf1c", "packages": [ { "name": "asika/simple-console", @@ -485,6 +485,7 @@ "jsonld.php" ] }, + "notification-url": "https://packagist.org/downloads/", "license": [ "BSD-3-Clause" ], @@ -502,11 +503,11 @@ "description": "A JSON-LD Processor and API implementation in PHP.", "homepage": "https://git.friendi.ca/friendica/php-json-ld", "keywords": [ - "JSON", "JSON-LD", "Linked Data", "RDF", "Semantic Web", + "json", "jsonld" ], "time": "2018-10-08T20:41:00+00:00" @@ -2971,6 +2972,54 @@ ], "time": "2016-01-20T08:20:44+00:00" }, + { + "name": "jakub-onderka/php-parallel-lint", + "version": "v1.0.0", + "source": { + "type": "git", + "url": "https://github.com/JakubOnderka/PHP-Parallel-Lint.git", + "reference": "04fbd3f5fb1c83f08724aa58a23db90bd9086ee8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/JakubOnderka/PHP-Parallel-Lint/zipball/04fbd3f5fb1c83f08724aa58a23db90bd9086ee8", + "reference": "04fbd3f5fb1c83f08724aa58a23db90bd9086ee8", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "require-dev": { + "jakub-onderka/php-console-highlighter": "~0.3", + "nette/tester": "~1.3", + "squizlabs/php_codesniffer": "~2.7" + }, + "suggest": { + "jakub-onderka/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/JakubOnderka/PHP-Parallel-Lint", + "time": "2018-02-24T15:31:20+00:00" + }, { "name": "johnkary/phpunit-speedtrap", "version": "v1.1.0", @@ -3876,7 +3925,7 @@ } ], "description": "Provides the functionality to compare PHP values for equality", - "homepage": "http://www.github.com/sebastianbergmann/comparator", + "homepage": "https://github.com/sebastianbergmann/comparator", "keywords": [ "comparator", "compare", @@ -3978,7 +4027,7 @@ } ], "description": "Provides functionality to handle HHVM/PHP environments", - "homepage": "http://www.github.com/sebastianbergmann/environment", + "homepage": "https://github.com/sebastianbergmann/environment", "keywords": [ "Xdebug", "environment", @@ -4046,7 +4095,7 @@ } ], "description": "Provides the functionality to export PHP variables for visualization", - "homepage": "http://www.github.com/sebastianbergmann/exporter", + "homepage": "https://github.com/sebastianbergmann/exporter", "keywords": [ "export", "exporter" @@ -4098,7 +4147,7 @@ } ], "description": "Snapshotting of global state", - "homepage": "http://www.github.com/sebastianbergmann/global-state", + "homepage": "https://github.com/sebastianbergmann/global-state", "keywords": [ "global state" ], @@ -4200,7 +4249,7 @@ } ], "description": "Provides functionality to recursively process PHP variables", - "homepage": "http://www.github.com/sebastianbergmann/recursion-context", + "homepage": "https://github.com/sebastianbergmann/recursion-context", "time": "2016-11-19T07:33:16+00:00" }, { diff --git a/tests/src/Console/ConfigConsoleTest.php b/tests/src/Console/ConfigConsoleTest.php index 05ed3f3c1e..cfdbf60377 100644 --- a/tests/src/Console/ConfigConsoleTest.php +++ b/tests/src/Console/ConfigConsoleTest.php @@ -33,6 +33,8 @@ class ConfigConsoleTest extends ConsoleTest * @var App\Mode|MockInterface $appMode */ private $appMode; + /** @var IConfig|\Mockery\LegacyMockInterface|MockInterface */ + private $configMock; protected function setUp() { -- 2.39.5