From ee2252c6acf5e30a3af80c270f8e86c575f46415 Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Fri, 14 Feb 2020 16:36:11 +0100 Subject: [PATCH] Add lint check after phar is built The initial 1.10.0-RC build (https://github.com/composer/getcomposer.org/commit/593b8dfb294fc0b0c75b85e0502922ff442ff63c) had what looks like a bit flip of one > into a :, causing a parse error as $foo->bar became $foo-:bar in some class. This is quite unpleasant and easy to miss as it requires including the file in question before the error is spotted. It was quite lucky I ran a composer install with the new phar right after to do something else and spotted the error. Linting all files covers this problem mostly, at least for the PHP files. --- composer.lock | 22 ++++++++++++---------- src/Composer/Compiler.php | 3 +++ 2 files changed, 15 insertions(+), 10 deletions(-) diff --git a/composer.lock b/composer.lock index 9bb5c8a15..9542f4167 100644 --- a/composer.lock +++ b/composer.lock @@ -407,16 +407,16 @@ }, { "name": "seld/phar-utils", - "version": "1.0.2", + "version": "1.1.0", "source": { "type": "git", "url": "https://github.com/Seldaek/phar-utils.git", - "reference": "84715761c35808076b00908a20317a3a8a67d17e" + "reference": "8800503d56b9867d43d9c303b9cbcc26016e82f0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Seldaek/phar-utils/zipball/84715761c35808076b00908a20317a3a8a67d17e", - "reference": "84715761c35808076b00908a20317a3a8a67d17e", + "url": "https://api.github.com/repos/Seldaek/phar-utils/zipball/8800503d56b9867d43d9c303b9cbcc26016e82f0", + "reference": "8800503d56b9867d43d9c303b9cbcc26016e82f0", "shasum": "" }, "require": { @@ -445,9 +445,9 @@ ], "description": "PHAR file format utilities, for when PHP phars you up", "keywords": [ - "phra" + "phar" ], - "time": "2020-01-13T10:41:09+00:00" + "time": "2020-02-14T15:25:33+00:00" }, { "name": "symfony/console", @@ -901,10 +901,6 @@ "constructor", "instantiate" ], - "support": { - "issues": "https://github.com/doctrine/instantiator/issues", - "source": "https://github.com/doctrine/instantiator/tree/master" - }, "time": "2015-06-14T21:17:01+00:00" }, { @@ -948,6 +944,12 @@ "license": [ "MIT" ], + "authors": [ + { + "name": "Mike van Riel", + "email": "mike.vanriel@naenius.com" + } + ], "time": "2016-01-25T08:17:30+00:00" }, { diff --git a/src/Composer/Compiler.php b/src/Composer/Compiler.php index 2c763d053..a4b8c2a92 100644 --- a/src/Composer/Compiler.php +++ b/src/Composer/Compiler.php @@ -18,6 +18,7 @@ use Composer\CaBundle\CaBundle; use Symfony\Component\Finder\Finder; use Symfony\Component\Process\Process; use Seld\PharUtils\Timestamps; +use Seld\PharUtils\Linter; /** * The Compiler class compiles composer into a phar @@ -162,6 +163,8 @@ class Compiler $util = new Timestamps($pharFile); $util->updateTimestamps($this->versionDate); $util->save($pharFile, \Phar::SHA1); + + Linter::lint($pharFile); } /**