From e3490705a7f0ee6fea569c159af7ba556d2aab0e Mon Sep 17 00:00:00 2001 From: Cees-Jan Kiewiet Date: Sun, 14 Jan 2018 20:01:44 +0100 Subject: [PATCH 1/4] Enforce indentation_type --- src/PhpCsFixerConfig.php | 1 + 1 file changed, 1 insertion(+) diff --git a/src/PhpCsFixerConfig.php b/src/PhpCsFixerConfig.php index 5c8f03f..27d63d1 100644 --- a/src/PhpCsFixerConfig.php +++ b/src/PhpCsFixerConfig.php @@ -18,6 +18,7 @@ public static function create(array $extraRules = []): Config 'array_syntax' => [ 'syntax' => 'short', ], + 'indentation_type' => true, 'blank_line_before_return' => true, 'declare_strict_types' => true, 'method_separation' => true, From eb0c31b198931c18ff7b6052c48961b88aef8f4c Mon Sep 17 00:00:00 2001 From: Cees-Jan Kiewiet Date: Mon, 15 Jan 2018 16:49:54 +0100 Subject: [PATCH 2/4] Use @localheinz's composer normalize --- composer.json | 26 ++++-- composer.lock | 221 +++++++++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 238 insertions(+), 9 deletions(-) diff --git a/composer.json b/composer.json index 86f662d..a1b6d36 100644 --- a/composer.json +++ b/composer.json @@ -14,9 +14,17 @@ "friendsofphp/php-cs-fixer": "^2.5", "jakub-onderka/php-console-highlighter": "^0.3.2", "jakub-onderka/php-parallel-lint": "^0.9.2", + "localheinz/composer-normalize": "^0.1.0", "phake/phake": "^3.0.1", "phpunit/phpunit": "^6.2" }, + "require-dev": {}, + "config": { + "platform": { + "php": "7.0" + }, + "sort-packages": true + }, "autoload": { "psr-4": { "ApiClients\\Tools\\TestUtilities\\": "src/" @@ -27,15 +35,13 @@ "ApiClients\\Tests\\Tools\\TestUtilities\\": "tests/" } }, - "require-dev": { - }, - "config": { - "sort-packages": true, - "platform": { - "php": "7.0" - } - }, "scripts": { + "post-update-cmd": [ + "composer normalize" + ], + "post-install-cmd": [ + "composer normalize" + ], "ensure-installed": "composer install --ansi -n -q", "cs": [ "@ensure-installed", @@ -58,11 +64,15 @@ "parallel-lint --exclude vendor ." ], "qa-all": [ + "composer validate", + "composer normalize", "@lint-php", "@cs", "@unit" ], "qa-all-coverage": [ + "composer validate", + "composer normalize", "@lint-php", "@cs", "@unit-coverage" diff --git a/composer.lock b/composer.lock index fa8d260..b577cb2 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "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": "2574a9b901d4895f4f257e165e5ea9b7", + "content-hash": "52385099860e28cb024452174cb08c01", "packages": [ { "name": "clue/block-react", @@ -490,6 +490,225 @@ "homepage": "https://github.com/JakubOnderka/PHP-Parallel-Lint", "time": "2015-12-15T10:42:16+00:00" }, + { + "name": "justinrainbow/json-schema", + "version": "5.2.6", + "source": { + "type": "git", + "url": "https://github.com/justinrainbow/json-schema.git", + "reference": "d283e11b6e14c6f4664cf080415c4341293e5bbd" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/justinrainbow/json-schema/zipball/d283e11b6e14c6f4664cf080415c4341293e5bbd", + "reference": "d283e11b6e14c6f4664cf080415c4341293e5bbd", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "require-dev": { + "friendsofphp/php-cs-fixer": "^2.1", + "json-schema/json-schema-test-suite": "1.2.0", + "phpunit/phpunit": "^4.8.22" + }, + "bin": [ + "bin/validate-json" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "5.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "JsonSchema\\": "src/JsonSchema/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Bruno Prieto Reis", + "email": "bruno.p.reis@gmail.com" + }, + { + "name": "Justin Rainbow", + "email": "justin.rainbow@gmail.com" + }, + { + "name": "Igor Wiedler", + "email": "igor@wiedler.ch" + }, + { + "name": "Robert Schönthal", + "email": "seroscho@googlemail.com" + } + ], + "description": "A library to validate a json schema.", + "homepage": "https://github.com/justinrainbow/json-schema", + "keywords": [ + "json", + "schema" + ], + "time": "2017-10-21T13:15:38+00:00" + }, + { + "name": "localheinz/composer-normalize", + "version": "0.1.0", + "source": { + "type": "git", + "url": "https://github.com/localheinz/composer-normalize.git", + "reference": "d45da477cc66f8e68564e8551cec3b29137bd3f3" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/localheinz/composer-normalize/zipball/d45da477cc66f8e68564e8551cec3b29137bd3f3", + "reference": "d45da477cc66f8e68564e8551cec3b29137bd3f3", + "shasum": "" + }, + "require": { + "composer-plugin-api": "^1.1.0", + "localheinz/json-normalizer": "0.1.0", + "php": "^7.0" + }, + "require-dev": { + "composer/composer": "^1.1.0", + "infection/infection": "~0.7.0", + "localheinz/php-cs-fixer-config": "~1.11.0", + "localheinz/test-util": "0.6.1", + "mikey179/vfsstream": "^1.6.5", + "phpunit/phpunit": "^6.5.5" + }, + "type": "composer-plugin", + "extra": { + "class": "Localheinz\\Composer\\Normalize\\NormalizePlugin" + }, + "autoload": { + "psr-4": { + "Localheinz\\Composer\\Normalize\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Andreas Möller", + "email": "am@localheinz.com" + } + ], + "description": "Provides a composer plugin for normalizing composer.json.", + "keywords": [ + "composer", + "normalize", + "normalizer", + "plugin" + ], + "time": "2018-01-14T12:15:12+00:00" + }, + { + "name": "localheinz/json-normalizer", + "version": "0.1.0", + "source": { + "type": "git", + "url": "https://github.com/localheinz/json-normalizer.git", + "reference": "443a53cef0a8adc96f857a79fb7c818fc7be388d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/localheinz/json-normalizer/zipball/443a53cef0a8adc96f857a79fb7c818fc7be388d", + "reference": "443a53cef0a8adc96f857a79fb7c818fc7be388d", + "shasum": "" + }, + "require": { + "justinrainbow/json-schema": "^4.0.0 || ^5.0.0", + "localheinz/json-printer": "^1.0.0", + "php": "^7.0" + }, + "require-dev": { + "infection/infection": "~0.7.0", + "localheinz/php-cs-fixer-config": "~1.11.0", + "localheinz/test-util": "0.6.1", + "phpbench/phpbench": "~0.14.0", + "phpspec/prophecy": "^1.7.1", + "phpunit/phpunit": "^6.5.5" + }, + "type": "library", + "autoload": { + "psr-4": { + "Localheinz\\Json\\Normalizer\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Andreas Möller", + "email": "am@localheinz.com" + } + ], + "description": "Provides normalizers for normalizing JSON documents.", + "keywords": [ + "json", + "normalizer" + ], + "time": "2018-01-13T21:59:29+00:00" + }, + { + "name": "localheinz/json-printer", + "version": "1.0.0", + "source": { + "type": "git", + "url": "https://github.com/localheinz/json-printer.git", + "reference": "c5aba96ad796560651770bcd16be8b19f324c343" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/localheinz/json-printer/zipball/c5aba96ad796560651770bcd16be8b19f324c343", + "reference": "c5aba96ad796560651770bcd16be8b19f324c343", + "shasum": "" + }, + "require": { + "php": "^7.0" + }, + "require-dev": { + "infection/infection": "~0.7.0", + "localheinz/php-cs-fixer-config": "~1.9.0", + "localheinz/test-util": "0.6.1", + "phpbench/phpbench": "~0.14.0", + "phpunit/phpunit": "^6.5.5" + }, + "type": "library", + "autoload": { + "psr-4": { + "Localheinz\\Json\\Printer\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Andreas Möller", + "email": "am@localheinz.com" + } + ], + "description": "Provides a JSON printer, allowing for flexible indentation.", + "keywords": [ + "formatter", + "json", + "printer" + ], + "time": "2018-01-05T18:08:01+00:00" + }, { "name": "myclabs/deep-copy", "version": "1.6.1", From 2ef4d05e08ab8a26fed3060c1b9dd6fc83259c3e Mon Sep 17 00:00:00 2001 From: Cees-Jan Kiewiet Date: Mon, 15 Jan 2018 17:24:46 +0100 Subject: [PATCH 3/4] Update the lock file when dropping the platform config --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index 81ea2fe..c920e8e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -40,6 +40,7 @@ matrix: install: - composer validate - if [ -z "$dropPlatform" ]; then composer config --unset platform.php; fi; + - if [ -z "$dropPlatform" ]; then composer update --lock; fi; - if [ -z "$qaExtended" ]; then phpenv config-rm xdebug.ini || :; fi; - if [ -z "$dependencies" ]; then composer install --prefer-dist; fi; - if [ "$dependencies" = "lowest" ]; then composer update --prefer-lowest --prefer-dist -n; fi; From 3647c3c969fb34c171a0d1708f82f33a999afe3f Mon Sep 17 00:00:00 2001 From: Cees-Jan Kiewiet Date: Mon, 15 Jan 2018 18:47:10 +0100 Subject: [PATCH 4/4] Enable coloured output for validate and normalize --- composer.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/composer.json b/composer.json index a1b6d36..ff2ab8f 100644 --- a/composer.json +++ b/composer.json @@ -64,15 +64,15 @@ "parallel-lint --exclude vendor ." ], "qa-all": [ - "composer validate", - "composer normalize", + "composer validate --ansi", + "composer normalize --ansi", "@lint-php", "@cs", "@unit" ], "qa-all-coverage": [ - "composer validate", - "composer normalize", + "composer validate --ansi", + "composer normalize --ansi", "@lint-php", "@cs", "@unit-coverage"