From 986a4a96e3422c9eafd7d9c1867e932740bf5520 Mon Sep 17 00:00:00 2001 From: Matthew Grasmick Date: Thu, 7 Sep 2017 15:57:53 -0400 Subject: [PATCH] Fixes #1543: Twig Lint is not maintained and fails valid twig code. --- composer.json | 10 +- composer.lock | 552 ++++++++++++++------- src/Robo/Blt.php | 13 +- src/Robo/Commands/Git/GitCommand.php | 6 +- src/Robo/Commands/Validate/TwigCommand.php | 29 +- 5 files changed, 392 insertions(+), 218 deletions(-) diff --git a/composer.json b/composer.json index 843c91b8f0..f81e97393c 100644 --- a/composer.json +++ b/composer.json @@ -14,7 +14,6 @@ "type": "composer-plugin", "license": "GPL-2.0", "require": { - "asm89/twig-lint": "^1.0.2", "composer/installers": "^1.2.0", "composer-plugin-api": "^1.0.0", "doctrine/common": "^2.5", @@ -22,20 +21,21 @@ "oomphinc/composer-installers-extender": "^1.1", "dflydev/dot-access-data": "^1.1.0", "drupal/coder": "^8.2.11", - "drush/drush": "^8.1.10", + "drush/drush": "^9.0.0-beta4", "grasmash/drupal-security-warning": "^1.0.0", "grasmash/yaml-cli": "^1.0.0", "grasmash/yaml-expander": "^1.0.5", "php": ">=5.6", "phpunit/phpunit": "^4.8", "squizlabs/php_codesniffer": "^2.7", - "symfony/yaml": "^2.8.11|^3.2", - "symfony/console": "^2.8.11|^3.2", + "symfony/yaml": "^3.2", + "symfony/console": "^3.2", "wikimedia/composer-merge-plugin": "^1.4.1", "consolidation/robo": "^1.1.0", "consolidation/config": "^1.0.0", "dealerdirect/phpcodesniffer-composer-installer": "^0.4.0", - "tivie/php-os-detector": "^1.0" + "tivie/php-os-detector": "^1.0", + "symfony/twig-bridge": "^3.3" }, "autoload": { "psr-4": { diff --git a/composer.lock b/composer.lock index 3b3a58459f..762ffcf632 100644 --- a/composer.lock +++ b/composer.lock @@ -4,71 +4,59 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "content-hash": "4b5cf198d2d6b1fdc605a30cb9c8e404", + "content-hash": "9351755f817ea16ab00b2087b4e3bbd0", "packages": [ { - "name": "asm89/twig-lint", - "version": "1.0.2", + "name": "chi-teck/drupal-code-generator", + "version": "1.19.0", "source": { "type": "git", - "url": "https://github.com/asm89/twig-lint.git", - "reference": "bbf7bc49689ed55d2900de7528c528c93db19431" + "url": "https://github.com/Chi-teck/drupal-code-generator.git", + "reference": "42e93161e72ab1a958ad464bf15977e3ed7dc9fe" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/asm89/twig-lint/zipball/bbf7bc49689ed55d2900de7528c528c93db19431", - "reference": "bbf7bc49689ed55d2900de7528c528c93db19431", + "url": "https://api.github.com/repos/Chi-teck/drupal-code-generator/zipball/42e93161e72ab1a958ad464bf15977e3ed7dc9fe", + "reference": "42e93161e72ab1a958ad464bf15977e3ed7dc9fe", "shasum": "" }, "require": { - "symfony/console": "^2.1 || ^3.0", - "symfony/finder": "^2.1 || ^3.0", - "twig/twig": "^1.16.2" + "php": ">=5.5.9", + "symfony/console": "~2.7|^3", + "symfony/filesystem": "~2.7|^3", + "twig/twig": "^1.23.1" }, "bin": [ - "bin/twig-lint" + "bin/dcg" ], "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0-dev" - } - }, "autoload": { - "psr-0": { - "Asm89\\Twig\\Lint\\": "src/" + "files": [ + "src/bootstrap.php" + ], + "psr-4": { + "DrupalCodeGenerator\\": "src" } }, "notification-url": "https://packagist.org/downloads/", "license": [ - "MIT" - ], - "authors": [ - { - "name": "Alexander", - "email": "iam.asm89@gmail.com" - } + "GPL2" ], - "description": "Standalone twig linter.", - "homepage": "https://github.com/asm89/twig-lint", - "keywords": [ - "lint", - "twig" - ], - "time": "2016-07-25T21:02:13+00:00" + "description": "Drupal code generator", + "time": "2017-08-04T10:50:23+00:00" }, { "name": "composer/installers", - "version": "v1.3.0", + "version": "v1.4.0", "source": { "type": "git", "url": "https://github.com/composer/installers.git", - "reference": "79ad876c7498c0bbfe7eed065b8651c93bfd6045" + "reference": "9ce17fb70e9a38dd8acff0636a29f5cf4d575c1b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/installers/zipball/79ad876c7498c0bbfe7eed065b8651c93bfd6045", - "reference": "79ad876c7498c0bbfe7eed065b8651c93bfd6045", + "url": "https://api.github.com/repos/composer/installers/zipball/9ce17fb70e9a38dd8acff0636a29f5cf4d575c1b", + "reference": "9ce17fb70e9a38dd8acff0636a29f5cf4d575c1b", "shasum": "" }, "require": { @@ -114,6 +102,7 @@ "Hurad", "ImageCMS", "Kanboard", + "Lan Management System", "MODX Evo", "Mautic", "Maya", @@ -137,6 +126,7 @@ "croogo", "dokuwiki", "drupal", + "eZ Platform", "elgg", "expressionengine", "fuelphp", @@ -153,6 +143,7 @@ "mediawiki", "modulework", "moodle", + "osclass", "phpbb", "piwik", "ppi", @@ -169,26 +160,26 @@ "zend", "zikula" ], - "time": "2017-04-24T06:37:16+00:00" + "time": "2017-08-09T07:53:48+00:00" }, { "name": "consolidation/annotated-command", - "version": "2.4.11", + "version": "2.4.13", "source": { "type": "git", "url": "https://github.com/consolidation/annotated-command.git", - "reference": "7fbf68dc6abf2f1f0746ceab0701dee1ee97516e" + "reference": "abb685e42c83d0b698b4e22059e5d505588f7d3c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/consolidation/annotated-command/zipball/7fbf68dc6abf2f1f0746ceab0701dee1ee97516e", - "reference": "7fbf68dc6abf2f1f0746ceab0701dee1ee97516e", + "url": "https://api.github.com/repos/consolidation/annotated-command/zipball/abb685e42c83d0b698b4e22059e5d505588f7d3c", + "reference": "abb685e42c83d0b698b4e22059e5d505588f7d3c", "shasum": "" }, "require": { "consolidation/output-formatters": "^3.1.10", "php": ">=5.4.0", - "phpdocumentor/reflection-docblock": "^2.0|^3.0.2", + "phpdocumentor/reflection-docblock": "^2.0|^3.0.2|^4.0", "psr/log": "^1", "symfony/console": "^2.8|~3", "symfony/event-dispatcher": "^2.5|^3", @@ -221,7 +212,7 @@ } ], "description": "Initialize Symfony Console commands from annotated command class methods.", - "time": "2017-07-27T20:29:17+00:00" + "time": "2017-08-28T20:16:37+00:00" }, { "name": "consolidation/config", @@ -321,16 +312,16 @@ }, { "name": "consolidation/output-formatters", - "version": "3.1.10", + "version": "3.1.11", "source": { "type": "git", "url": "https://github.com/consolidation/output-formatters.git", - "reference": "3872f19517bfc9da0e14c9e5b6fe0f8c7439ea3a" + "reference": "3a1160440819269e6d8d9c11db67129384b8fb35" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/consolidation/output-formatters/zipball/3872f19517bfc9da0e14c9e5b6fe0f8c7439ea3a", - "reference": "3872f19517bfc9da0e14c9e5b6fe0f8c7439ea3a", + "url": "https://api.github.com/repos/consolidation/output-formatters/zipball/3a1160440819269e6d8d9c11db67129384b8fb35", + "reference": "3a1160440819269e6d8d9c11db67129384b8fb35", "shasum": "" }, "require": { @@ -366,7 +357,7 @@ } ], "description": "Format text by applying transformations provided by plug-in formatters.", - "time": "2017-06-06T19:08:54+00:00" + "time": "2017-08-17T22:11:07+00:00" }, { "name": "consolidation/robo", @@ -480,16 +471,16 @@ }, { "name": "dealerdirect/phpcodesniffer-composer-installer", - "version": "v0.4.1", + "version": "v0.4.2", "source": { "type": "git", "url": "https://github.com/DealerDirect/phpcodesniffer-composer-installer.git", - "reference": "b437eb358b5e592668502a79d95c6d18f8c41ee8" + "reference": "17130f536db62570bcfc5cce59464b36e82eb092" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/DealerDirect/phpcodesniffer-composer-installer/zipball/b437eb358b5e592668502a79d95c6d18f8c41ee8", - "reference": "b437eb358b5e592668502a79d95c6d18f8c41ee8", + "url": "https://api.github.com/repos/DealerDirect/phpcodesniffer-composer-installer/zipball/17130f536db62570bcfc5cce59464b36e82eb092", + "reference": "17130f536db62570bcfc5cce59464b36e82eb092", "shasum": "" }, "require": { @@ -542,7 +533,7 @@ "stylecheck", "tests" ], - "time": "2017-08-01T12:43:41+00:00" + "time": "2017-08-16T10:25:17+00:00" }, { "name": "dflydev/dot-access-data", @@ -1128,57 +1119,59 @@ }, { "name": "drush/drush", - "version": "8.1.12", + "version": "9.0.0-beta4", "source": { "type": "git", "url": "https://github.com/drush-ops/drush.git", - "reference": "a1d3ab0f1d9ce01556d70015906caaed723f7ba7" + "reference": "69db709a4809a5ac55438c6164dfd07bb8113e97" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/drush-ops/drush/zipball/a1d3ab0f1d9ce01556d70015906caaed723f7ba7", - "reference": "a1d3ab0f1d9ce01556d70015906caaed723f7ba7", + "url": "https://api.github.com/repos/drush-ops/drush/zipball/69db709a4809a5ac55438c6164dfd07bb8113e97", + "reference": "69db709a4809a5ac55438c6164dfd07bb8113e97", "shasum": "" }, "require": { - "consolidation/annotated-command": "~2", - "consolidation/output-formatters": "~3", + "chi-teck/drupal-code-generator": "^1.17.3", + "consolidation/annotated-command": "^2.4.10", + "consolidation/output-formatters": "^3.1.11", + "consolidation/robo": "~1", + "ext-dom": "*", + "league/container": "~2", "pear/console_table": "~1.3.0", - "php": ">=5.4.5", + "php": ">=5.6.0", "phpdocumentor/reflection-docblock": "^2.0", "psr/log": "~1.0", "psy/psysh": "~0.6", - "symfony/console": "~2.7", - "symfony/event-dispatcher": "~2.7", - "symfony/finder": "~2.7", - "symfony/var-dumper": "~2.7", - "symfony/yaml": "~2.3", - "webmozart/path-util": "~2" + "sebastian/version": "~1", + "symfony/config": "~2.2|^3", + "symfony/console": "~2.7|^3", + "symfony/event-dispatcher": "~2.7|^3", + "symfony/finder": "~2.7|^3", + "symfony/process": "~2.7|^3", + "symfony/var-dumper": "~2.7|^3", + "symfony/yaml": "~2.3|^3", + "webflo/drupal-finder": "^1.0", + "webmozart/path-util": "^2.1.0" }, "require-dev": { - "phpunit/phpunit": "4.*", - "symfony/process": "2.7.*" - }, - "suggest": { - "drush/config-extra": "Provides configuration workflow commands, such as config-merge.", - "ext-pcntl": "*" + "lox/xhprof": "dev-master", + "phpunit/phpunit": "^4", + "squizlabs/php_codesniffer": "^2.7" }, "bin": [ - "drush", - "drush.launcher", - "drush.php", - "drush.complete.sh" + "drush" ], "type": "library", "extra": { "branch-alias": { - "dev-master": "8.0.x-dev" + "dev-master": "9.0.x-dev" } }, "autoload": { - "psr-0": { - "Drush": "lib/", - "Consolidation": "lib/" + "psr-4": { + "Drush\\": "src/", + "Unish\\": "tests/" } }, "notification-url": "https://packagist.org/downloads/", @@ -1194,14 +1187,6 @@ "name": "Owen Barton", "email": "drupal@owenbarton.com" }, - { - "name": "Mark Sonnabaum", - "email": "marksonnabaum@gmail.com" - }, - { - "name": "Antoine Beaupré", - "email": "anarcat@koumbit.org" - }, { "name": "Greg Anderson", "email": "greg.1.anderson@greenknowe.org" @@ -1229,7 +1214,7 @@ ], "description": "Drush is a command line shell and scripting interface for Drupal, a veritable Swiss Army knife designed to make life easier for those of us who spend some of our working hours hacking away at the command prompt.", "homepage": "http://www.drush.org", - "time": "2017-06-05T22:51:34+00:00" + "time": "2017-08-26T18:11:03+00:00" }, { "name": "grasmash/drupal-security-warning", @@ -1280,24 +1265,24 @@ }, { "name": "grasmash/yaml-cli", - "version": "1.0.2", + "version": "1.0.3", "source": { "type": "git", "url": "https://github.com/grasmash/yaml-cli.git", - "reference": "7fa0d815547c6c003c8f92159ec789f065ebfacf" + "reference": "7facf30da454c33cc3babe361b14c71fef0bc339" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/grasmash/yaml-cli/zipball/7fa0d815547c6c003c8f92159ec789f065ebfacf", - "reference": "7fa0d815547c6c003c8f92159ec789f065ebfacf", + "url": "https://api.github.com/repos/grasmash/yaml-cli/zipball/7facf30da454c33cc3babe361b14c71fef0bc339", + "reference": "7facf30da454c33cc3babe361b14c71fef0bc339", "shasum": "" }, "require": { "dflydev/dot-access-data": "^1.1.0", "php": ">=5.6", - "symfony/console": "^2.8.11", - "symfony/filesystem": "^2.8.11", - "symfony/yaml": "^2.8.11" + "symfony/console": "^2.8.11|^3.2", + "symfony/filesystem": "^2.8.11|^3.2", + "symfony/yaml": "^2.8.11|^3.2" }, "require-dev": { "phpunit/phpunit": "^5.5.4", @@ -1323,7 +1308,7 @@ } ], "description": "A command line tool for reading and manipulating yaml files.", - "time": "2017-06-19T20:25:23+00:00" + "time": "2017-09-05T20:08:37+00:00" }, { "name": "grasmash/yaml-expander", @@ -1526,16 +1511,16 @@ }, { "name": "nikic/php-parser", - "version": "v3.1.0", + "version": "v3.1.1", "source": { "type": "git", "url": "https://github.com/nikic/PHP-Parser.git", - "reference": "4d4896e553f2094e657fe493506dc37c509d4e2b" + "reference": "a1e8e1a30e1352f118feff1a8481066ddc2f234a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/4d4896e553f2094e657fe493506dc37c509d4e2b", - "reference": "4d4896e553f2094e657fe493506dc37c509d4e2b", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/a1e8e1a30e1352f118feff1a8481066ddc2f234a", + "reference": "a1e8e1a30e1352f118feff1a8481066ddc2f234a", "shasum": "" }, "require": { @@ -1573,7 +1558,7 @@ "parser", "php" ], - "time": "2017-07-28T14:45:09+00:00" + "time": "2017-09-02T17:10:46+00:00" }, { "name": "oomphinc/composer-installers-extender", @@ -1723,22 +1708,22 @@ }, { "name": "phpspec/prophecy", - "version": "v1.7.0", + "version": "v1.7.2", "source": { "type": "git", "url": "https://github.com/phpspec/prophecy.git", - "reference": "93d39f1f7f9326d746203c7c056f300f7f126073" + "reference": "c9b8c6088acd19d769d4cc0ffa60a9fe34344bd6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpspec/prophecy/zipball/93d39f1f7f9326d746203c7c056f300f7f126073", - "reference": "93d39f1f7f9326d746203c7c056f300f7f126073", + "url": "https://api.github.com/repos/phpspec/prophecy/zipball/c9b8c6088acd19d769d4cc0ffa60a9fe34344bd6", + "reference": "c9b8c6088acd19d769d4cc0ffa60a9fe34344bd6", "shasum": "" }, "require": { "doctrine/instantiator": "^1.0.2", "php": "^5.3|^7.0", - "phpdocumentor/reflection-docblock": "^2.0|^3.0.2", + "phpdocumentor/reflection-docblock": "^2.0|^3.0.2|^4.0", "sebastian/comparator": "^1.1|^2.0", "sebastian/recursion-context": "^1.0|^2.0|^3.0" }, @@ -1749,7 +1734,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.6.x-dev" + "dev-master": "1.7.x-dev" } }, "autoload": { @@ -1782,7 +1767,7 @@ "spy", "stub" ], - "time": "2017-03-02T20:05:34+00:00" + "time": "2017-09-04T11:05:03+00:00" }, { "name": "phpunit/php-code-coverage", @@ -2779,39 +2764,108 @@ ], "time": "2017-05-22T02:43:20+00:00" }, + { + "name": "symfony/config", + "version": "v3.3.8", + "source": { + "type": "git", + "url": "https://github.com/symfony/config.git", + "reference": "6ac0cc1f047c1dbc058fc25b7a4d91b068ed4488" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/config/zipball/6ac0cc1f047c1dbc058fc25b7a4d91b068ed4488", + "reference": "6ac0cc1f047c1dbc058fc25b7a4d91b068ed4488", + "shasum": "" + }, + "require": { + "php": "^5.5.9|>=7.0.8", + "symfony/filesystem": "~2.8|~3.0" + }, + "conflict": { + "symfony/dependency-injection": "<3.3", + "symfony/finder": "<3.3" + }, + "require-dev": { + "symfony/dependency-injection": "~3.3", + "symfony/finder": "~3.3", + "symfony/yaml": "~3.0" + }, + "suggest": { + "symfony/yaml": "To use the yaml reference dumper" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.3-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Config\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Config Component", + "homepage": "https://symfony.com", + "time": "2017-08-03T08:59:45+00:00" + }, { "name": "symfony/console", - "version": "v2.8.26", + "version": "v3.3.8", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "32a3c6b3398de5db8ed381f4ef92970c59c2fcdd" + "reference": "d6596cb5022b6a0bd940eae54a1de78646a5fda6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/32a3c6b3398de5db8ed381f4ef92970c59c2fcdd", - "reference": "32a3c6b3398de5db8ed381f4ef92970c59c2fcdd", + "url": "https://api.github.com/repos/symfony/console/zipball/d6596cb5022b6a0bd940eae54a1de78646a5fda6", + "reference": "d6596cb5022b6a0bd940eae54a1de78646a5fda6", "shasum": "" }, "require": { - "php": ">=5.3.9", - "symfony/debug": "^2.7.2|~3.0.0", + "php": "^5.5.9|>=7.0.8", + "symfony/debug": "~2.8|~3.0", "symfony/polyfill-mbstring": "~1.0" }, + "conflict": { + "symfony/dependency-injection": "<3.3" + }, "require-dev": { "psr/log": "~1.0", - "symfony/event-dispatcher": "~2.1|~3.0.0", - "symfony/process": "~2.1|~3.0.0" + "symfony/config": "~3.3", + "symfony/dependency-injection": "~3.3", + "symfony/event-dispatcher": "~2.8|~3.0", + "symfony/filesystem": "~2.8|~3.0", + "symfony/process": "~2.8|~3.0" }, "suggest": { "psr/log": "For using the console logger", "symfony/event-dispatcher": "", + "symfony/filesystem": "", "symfony/process": "" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.8-dev" + "dev-master": "3.3-dev" } }, "autoload": { @@ -2838,37 +2892,36 @@ ], "description": "Symfony Console Component", "homepage": "https://symfony.com", - "time": "2017-07-29T21:26:04+00:00" + "time": "2017-08-27T14:52:21+00:00" }, { "name": "symfony/debug", - "version": "v3.0.9", + "version": "v3.3.8", "source": { "type": "git", "url": "https://github.com/symfony/debug.git", - "reference": "697c527acd9ea1b2d3efac34d9806bf255278b0a" + "reference": "084d804fe35808eb2ef596ec83d85d9768aa6c9d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/debug/zipball/697c527acd9ea1b2d3efac34d9806bf255278b0a", - "reference": "697c527acd9ea1b2d3efac34d9806bf255278b0a", + "url": "https://api.github.com/repos/symfony/debug/zipball/084d804fe35808eb2ef596ec83d85d9768aa6c9d", + "reference": "084d804fe35808eb2ef596ec83d85d9768aa6c9d", "shasum": "" }, "require": { - "php": ">=5.5.9", + "php": "^5.5.9|>=7.0.8", "psr/log": "~1.0" }, "conflict": { "symfony/http-kernel": ">=2.3,<2.3.24|~2.4.0|>=2.5,<2.5.9|>=2.6,<2.6.2" }, "require-dev": { - "symfony/class-loader": "~2.8|~3.0", "symfony/http-kernel": "~2.8|~3.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.0-dev" + "dev-master": "3.3-dev" } }, "autoload": { @@ -2895,31 +2948,34 @@ ], "description": "Symfony Debug Component", "homepage": "https://symfony.com", - "time": "2016-07-30T07:22:48+00:00" + "time": "2017-08-27T14:52:21+00:00" }, { "name": "symfony/event-dispatcher", - "version": "v2.8.26", + "version": "v3.3.8", "source": { "type": "git", "url": "https://github.com/symfony/event-dispatcher.git", - "reference": "1377400fd641d7d1935981546aaef780ecd5bf6d" + "reference": "54ca9520a00386f83bca145819ad3b619aaa2485" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/1377400fd641d7d1935981546aaef780ecd5bf6d", - "reference": "1377400fd641d7d1935981546aaef780ecd5bf6d", + "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/54ca9520a00386f83bca145819ad3b619aaa2485", + "reference": "54ca9520a00386f83bca145819ad3b619aaa2485", "shasum": "" }, "require": { - "php": ">=5.3.9" + "php": "^5.5.9|>=7.0.8" + }, + "conflict": { + "symfony/dependency-injection": "<3.3" }, "require-dev": { "psr/log": "~1.0", - "symfony/config": "^2.0.5|~3.0.0", - "symfony/dependency-injection": "~2.6|~3.0.0", - "symfony/expression-language": "~2.6|~3.0.0", - "symfony/stopwatch": "~2.3|~3.0.0" + "symfony/config": "~2.8|~3.0", + "symfony/dependency-injection": "~3.3", + "symfony/expression-language": "~2.8|~3.0", + "symfony/stopwatch": "~2.8|~3.0" }, "suggest": { "symfony/dependency-injection": "", @@ -2928,7 +2984,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "2.8-dev" + "dev-master": "3.3-dev" } }, "autoload": { @@ -2955,29 +3011,29 @@ ], "description": "Symfony EventDispatcher Component", "homepage": "https://symfony.com", - "time": "2017-06-02T07:47:27+00:00" + "time": "2017-07-29T21:54:42+00:00" }, { "name": "symfony/filesystem", - "version": "v2.8.26", + "version": "v3.3.8", "source": { "type": "git", "url": "https://github.com/symfony/filesystem.git", - "reference": "714b1036010c354ae2b25d7f9ca27e14e265e9f2" + "reference": "b32a0e5f928d0fa3d1dd03c78d020777e50c10cb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/filesystem/zipball/714b1036010c354ae2b25d7f9ca27e14e265e9f2", - "reference": "714b1036010c354ae2b25d7f9ca27e14e265e9f2", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/b32a0e5f928d0fa3d1dd03c78d020777e50c10cb", + "reference": "b32a0e5f928d0fa3d1dd03c78d020777e50c10cb", "shasum": "" }, "require": { - "php": ">=5.3.9" + "php": "^5.5.9|>=7.0.8" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.8-dev" + "dev-master": "3.3-dev" } }, "autoload": { @@ -3004,29 +3060,29 @@ ], "description": "Symfony Filesystem Component", "homepage": "https://symfony.com", - "time": "2017-07-11T07:12:11+00:00" + "time": "2017-07-29T21:54:42+00:00" }, { "name": "symfony/finder", - "version": "v2.8.26", + "version": "v3.3.8", "source": { "type": "git", "url": "https://github.com/symfony/finder.git", - "reference": "4f4e84811004e065a3bb5ceeb1d9aa592630f9ad" + "reference": "b2260dbc80f3c4198f903215f91a1ac7fe9fe09e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/4f4e84811004e065a3bb5ceeb1d9aa592630f9ad", - "reference": "4f4e84811004e065a3bb5ceeb1d9aa592630f9ad", + "url": "https://api.github.com/repos/symfony/finder/zipball/b2260dbc80f3c4198f903215f91a1ac7fe9fe09e", + "reference": "b2260dbc80f3c4198f903215f91a1ac7fe9fe09e", "shasum": "" }, "require": { - "php": ">=5.3.9" + "php": "^5.5.9|>=7.0.8" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.8-dev" + "dev-master": "3.3-dev" } }, "autoload": { @@ -3053,20 +3109,20 @@ ], "description": "Symfony Finder Component", "homepage": "https://symfony.com", - "time": "2017-06-01T20:52:29+00:00" + "time": "2017-07-29T21:54:42+00:00" }, { "name": "symfony/polyfill-mbstring", - "version": "v1.4.0", + "version": "v1.5.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "f29dca382a6485c3cbe6379f0c61230167681937" + "reference": "7c8fae0ac1d216eb54349e6a8baa57d515fe8803" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/f29dca382a6485c3cbe6379f0c61230167681937", - "reference": "f29dca382a6485c3cbe6379f0c61230167681937", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/7c8fae0ac1d216eb54349e6a8baa57d515fe8803", + "reference": "7c8fae0ac1d216eb54349e6a8baa57d515fe8803", "shasum": "" }, "require": { @@ -3078,7 +3134,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.4-dev" + "dev-master": "1.5-dev" } }, "autoload": { @@ -3112,24 +3168,24 @@ "portable", "shim" ], - "time": "2017-06-09T14:24:12+00:00" + "time": "2017-06-14T15:44:48+00:00" }, { "name": "symfony/process", - "version": "v3.3.6", + "version": "v3.3.8", "source": { "type": "git", "url": "https://github.com/symfony/process.git", - "reference": "07432804942b9f6dd7b7377faf9920af5f95d70a" + "reference": "b7666e9b438027a1ea0e1ee813ec5042d5d7f6f0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/07432804942b9f6dd7b7377faf9920af5f95d70a", - "reference": "07432804942b9f6dd7b7377faf9920af5f95d70a", + "url": "https://api.github.com/repos/symfony/process/zipball/b7666e9b438027a1ea0e1ee813ec5042d5d7f6f0", + "reference": "b7666e9b438027a1ea0e1ee813ec5042d5d7f6f0", "shasum": "" }, "require": { - "php": ">=5.5.9" + "php": "^5.5.9|>=7.0.8" }, "type": "library", "extra": { @@ -3161,24 +3217,111 @@ ], "description": "Symfony Process Component", "homepage": "https://symfony.com", - "time": "2017-07-13T13:05:09+00:00" + "time": "2017-07-29T21:54:42+00:00" + }, + { + "name": "symfony/twig-bridge", + "version": "v3.3.8", + "source": { + "type": "git", + "url": "https://github.com/symfony/twig-bridge.git", + "reference": "9c12e8f02937a1edfa02fcc73282c7c1a18304b2" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/twig-bridge/zipball/9c12e8f02937a1edfa02fcc73282c7c1a18304b2", + "reference": "9c12e8f02937a1edfa02fcc73282c7c1a18304b2", + "shasum": "" + }, + "require": { + "php": "^5.5.9|>=7.0.8", + "twig/twig": "~1.34|~2.4" + }, + "conflict": { + "symfony/form": "<3.2.10|~3.3,<3.3.3" + }, + "require-dev": { + "fig/link-util": "^1.0", + "symfony/asset": "~2.8|~3.0", + "symfony/console": "~2.8|~3.0", + "symfony/expression-language": "~2.8|~3.0", + "symfony/finder": "~2.8|~3.0", + "symfony/form": "^3.2.10|^3.3.3", + "symfony/http-kernel": "~3.2", + "symfony/polyfill-intl-icu": "~1.0", + "symfony/routing": "~2.8|~3.0", + "symfony/security": "~2.8|~3.0", + "symfony/security-acl": "~2.8|~3.0", + "symfony/stopwatch": "~2.8|~3.0", + "symfony/templating": "~2.8|~3.0", + "symfony/translation": "~2.8|~3.0", + "symfony/var-dumper": "~2.8.10|~3.1.4|~3.2", + "symfony/web-link": "~3.3", + "symfony/yaml": "~2.8|~3.0" + }, + "suggest": { + "symfony/asset": "For using the AssetExtension", + "symfony/expression-language": "For using the ExpressionExtension", + "symfony/finder": "", + "symfony/form": "For using the FormExtension", + "symfony/http-kernel": "For using the HttpKernelExtension", + "symfony/routing": "For using the RoutingExtension", + "symfony/security": "For using the SecurityExtension", + "symfony/stopwatch": "For using the StopwatchExtension", + "symfony/templating": "For using the TwigEngine", + "symfony/translation": "For using the TranslationExtension", + "symfony/var-dumper": "For using the DumpExtension", + "symfony/web-link": "For using the WebLinkExtension", + "symfony/yaml": "For using the YamlExtension" + }, + "type": "symfony-bridge", + "extra": { + "branch-alias": { + "dev-master": "3.3-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Bridge\\Twig\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Twig Bridge", + "homepage": "https://symfony.com", + "time": "2017-07-29T21:54:42+00:00" }, { "name": "symfony/var-dumper", - "version": "v2.8.26", + "version": "v3.3.8", "source": { "type": "git", "url": "https://github.com/symfony/var-dumper.git", - "reference": "e9337f23b1c080df301d25b8891ecf1607b0b72f" + "reference": "89fcb5a73e0ede2be2512234c4e40457bb22b35f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/var-dumper/zipball/e9337f23b1c080df301d25b8891ecf1607b0b72f", - "reference": "e9337f23b1c080df301d25b8891ecf1607b0b72f", + "url": "https://api.github.com/repos/symfony/var-dumper/zipball/89fcb5a73e0ede2be2512234c4e40457bb22b35f", + "reference": "89fcb5a73e0ede2be2512234c4e40457bb22b35f", "shasum": "" }, "require": { - "php": ">=5.3.9", + "php": "^5.5.9|>=7.0.8", "symfony/polyfill-mbstring": "~1.0" }, "conflict": { @@ -3195,7 +3338,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "2.8-dev" + "dev-master": "3.3-dev" } }, "autoload": { @@ -3229,29 +3372,35 @@ "debug", "dump" ], - "time": "2017-07-26T06:29:15+00:00" + "time": "2017-08-27T14:52:21+00:00" }, { "name": "symfony/yaml", - "version": "v2.8.26", + "version": "v3.3.8", "source": { "type": "git", "url": "https://github.com/symfony/yaml.git", - "reference": "4c29dec8d489c4e37cf87ccd7166cd0b0e6a45c5" + "reference": "1d8c2a99c80862bdc3af94c1781bf70f86bccac0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/yaml/zipball/4c29dec8d489c4e37cf87ccd7166cd0b0e6a45c5", - "reference": "4c29dec8d489c4e37cf87ccd7166cd0b0e6a45c5", + "url": "https://api.github.com/repos/symfony/yaml/zipball/1d8c2a99c80862bdc3af94c1781bf70f86bccac0", + "reference": "1d8c2a99c80862bdc3af94c1781bf70f86bccac0", "shasum": "" }, "require": { - "php": ">=5.3.9" + "php": "^5.5.9|>=7.0.8" + }, + "require-dev": { + "symfony/console": "~2.8|~3.0" + }, + "suggest": { + "symfony/console": "For validating YAML files using the lint command" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.8-dev" + "dev-master": "3.3-dev" } }, "autoload": { @@ -3278,7 +3427,7 @@ ], "description": "Symfony Yaml Component", "homepage": "https://symfony.com", - "time": "2017-06-01T20:52:29+00:00" + "time": "2017-07-29T21:54:42+00:00" }, { "name": "tivie/php-os-detector", @@ -3393,6 +3542,43 @@ ], "time": "2017-07-04T13:19:31+00:00" }, + { + "name": "webflo/drupal-finder", + "version": "1.0.0", + "source": { + "type": "git", + "url": "https://github.com/webflo/drupal-finder.git", + "reference": "3216448cc347bc77127fa3bf6497ba9b3c296e9c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/webflo/drupal-finder/zipball/3216448cc347bc77127fa3bf6497ba9b3c296e9c", + "reference": "3216448cc347bc77127fa3bf6497ba9b3c296e9c", + "shasum": "" + }, + "require-dev": { + "mikey179/vfsstream": "^1.6", + "phpunit/phpunit": "^4.8" + }, + "type": "library", + "autoload": { + "classmap": [ + "src/DrupalFinder.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "GPL-2.0+" + ], + "authors": [ + { + "name": "Florian Weber", + "email": "florian@webflo.org" + } + ], + "description": "Helper class to locate a Drupal installation from a given path.", + "time": "2017-08-08T08:31:26+00:00" + }, { "name": "webmozart/assert", "version": "1.2.0", @@ -3605,12 +3791,12 @@ "source": { "type": "git", "url": "https://github.com/composer/composer.git", - "reference": "189ba423aedc387a0487df40afc2428947406327" + "reference": "d9885d5b3bd1b28a6d8c679df848540e565ee818" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/composer/zipball/189ba423aedc387a0487df40afc2428947406327", - "reference": "189ba423aedc387a0487df40afc2428947406327", + "url": "https://api.github.com/repos/composer/composer/zipball/d9885d5b3bd1b28a6d8c679df848540e565ee818", + "reference": "d9885d5b3bd1b28a6d8c679df848540e565ee818", "shasum": "" }, "require": { @@ -3643,7 +3829,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.5-dev" + "dev-master": "1.6-dev" } }, "autoload": { @@ -3674,7 +3860,7 @@ "dependency", "package" ], - "time": "2017-07-20 10:08:41" + "time": "2017-08-21 07:16:59" }, { "name": "composer/semver", diff --git a/src/Robo/Blt.php b/src/Robo/Blt.php index 4312c82e53..5dfe7c984f 100644 --- a/src/Robo/Blt.php +++ b/src/Robo/Blt.php @@ -24,6 +24,7 @@ use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Input\InputOption; use Symfony\Component\Console\Output\OutputInterface; +use Symfony\Bridge\Twig\Command\LintCommand; /** * The BLT Robo application. @@ -78,6 +79,7 @@ public function __construct( $this->configureContainer($container); $this->addBuiltInCommandsAndHooks(); $this->addPluginsCommandsAndHooks(); + $this->addSymfonyCommands($application); $this->runner = new RoboRunner(); $this->runner->setContainer($container); @@ -115,6 +117,15 @@ private function addPluginsCommandsAndHooks() { $this->commands = array_merge($this->commands, $plugin_commands_hooks); } + /** + * Adds Symfony (non-Robo) command classes to the application. + * + * @param \Acquia\Blt\Robo\Application $application + */ + protected function addSymfonyCommands(Application $application) { + $application->add(new LintCommand('validate:twig:files')); + } + /** * Discovers command classes using CommandFileDiscovery. * @@ -159,7 +170,7 @@ private function getHooks( /** * Add any global arguments or options that apply to all commands. * - * @param \Symfony\Component\Console\Application $app + * @param \Acquia\Blt\Robo\Application $app * The Symfony application. */ private function addDefaultArgumentsAndOptions(Application $app) { diff --git a/src/Robo/Commands/Git/GitCommand.php b/src/Robo/Commands/Git/GitCommand.php index 18928c9534..e090f9c3fa 100644 --- a/src/Robo/Commands/Git/GitCommand.php +++ b/src/Robo/Commands/Git/GitCommand.php @@ -3,6 +3,8 @@ namespace Acquia\Blt\Robo\Commands\Git; use Acquia\Blt\Robo\BltTasks; +use function explode; +use function implode; /** * Defines commands in the "git:*" namespace. @@ -52,7 +54,9 @@ public function preCommitHook($changed_files) { // be sniffed, regardless of the extensions or patterns defined in // phpcs.xml. So, we do not use validate:phpcs:files. 'validate:phpcs' => [], - 'validate:twig:files' => ['file_list' => $changed_files], + 'validate:twig:files' => [ + 'file_list' => implode(' ', explode("\n", $changed_files)), + ], 'validate:yaml:files' => ['file_list' => $changed_files], ]); diff --git a/src/Robo/Commands/Validate/TwigCommand.php b/src/Robo/Commands/Validate/TwigCommand.php index 9ce08c5cc1..8ed2af5242 100644 --- a/src/Robo/Commands/Validate/TwigCommand.php +++ b/src/Robo/Commands/Validate/TwigCommand.php @@ -26,35 +26,8 @@ public function lintFileSets() { $fileset_ids = $this->getConfigValue('validate.twig.filesets'); $filesets = $fileset_manager->getFilesets($fileset_ids); $bin = $this->getConfigValue('composer.bin'); - $command = "'$bin/twig-lint' lint --only-print-errors '%s'"; + $command = "'$bin/blt lint:twig' lint --only-print-errors '%s'"; $this->executeCommandAgainstFilesets($filesets, $command, TRUE); } - /** - * Executes Twig validator against a list of files, if in twig.filesets. - * - * @command validate:twig:files - * - * @param string $file_list - * A list of files to scan, separated by \n. - */ - public function lintFileList($file_list) { - $this->say("Linting twig files..."); - - $files = explode("\n", $file_list); - - /** @var \Acquia\Blt\Robo\Filesets\FilesetManager $fileset_manager */ - $fileset_manager = $this->getContainer()->get('filesetManager'); - $fileset_ids = $this->getConfigValue('validate.twig.filesets'); - $filesets = $fileset_manager->getFilesets($fileset_ids); - - $bin = $this->getConfigValue('composer.bin'); - $command = "'$bin/twig-lint' lint --only-print-errors '%s'"; - foreach ($filesets as $fileset_id => $fileset) { - $filesets[$fileset_id] = $fileset_manager->filterFilesByFileset($files, $fileset); - } - - $this->executeCommandAgainstFilesets($filesets, $command); - } - }