From 190ffd8672c1af26df594639c038d0b14b198c6e Mon Sep 17 00:00:00 2001 From: Matthew Weier O'Phinney Date: Thu, 16 Feb 2017 14:28:58 -0600 Subject: [PATCH] Added license-check to QA toolchain - Now require `malukehno/docheader` in development. - Added configuration via `.docheader`. - `license-check` will check all `src/` files. - `license-check-all` will check all `src/` and `test/` files; there are test assets that are _expected_ to fail. - Travis runs `license-check` for targets doing CS checks. --- .docheader | 5 + .travis.yml | 1 + composer.json | 8 +- composer.lock | 327 +++++++++++++++++- src/AbstractConfigFactory.php | 8 +- src/Config.php | 8 +- src/Exception/ExceptionInterface.php | 8 +- src/Exception/InvalidArgumentException.php | 8 +- src/Exception/RuntimeException.php | 8 +- src/Factory.php | 8 +- src/Processor/Constant.php | 8 +- src/Processor/Filter.php | 8 +- src/Processor/ProcessorInterface.php | 8 +- src/Processor/Queue.php | 8 +- src/Processor/Token.php | 8 +- src/Processor/Translator.php | 8 +- src/Reader/Ini.php | 8 +- src/Reader/JavaProperties.php | 8 +- src/Reader/Json.php | 8 +- src/Reader/ReaderInterface.php | 8 +- src/Reader/Xml.php | 8 +- src/Reader/Yaml.php | 8 +- src/ReaderPluginManager.php | 8 +- src/Writer/AbstractWriter.php | 8 +- src/Writer/Ini.php | 8 +- src/Writer/Json.php | 8 +- src/Writer/PhpArray.php | 8 +- src/Writer/WriterInterface.php | 8 +- src/Writer/Xml.php | 8 +- src/Writer/Yaml.php | 8 +- src/WriterPluginManager.php | 8 +- test/AbstractConfigFactoryTest.php | 9 +- test/ConfigTest.php | 8 +- test/FactoryTest.php | 8 +- test/ProcessorTest.php | 8 +- test/Reader/AbstractReaderTestCase.php | 8 +- test/Reader/IniTest.php | 8 +- test/Reader/JavaPropertiesTest.php | 8 +- test/Reader/JsonTest.php | 8 +- test/Reader/TestAssets/DummyReader.php | 8 +- test/Reader/XmlTest.php | 8 +- test/Reader/YamlTest.php | 8 +- test/ReaderPluginManagerCompatibilityTest.php | 8 +- test/Writer/AbstractWriterTestCase.php | 8 +- test/Writer/IniTest.php | 8 +- test/Writer/JsonTest.php | 8 +- test/Writer/PhpArrayTest.php | 8 +- test/Writer/TestAssets/DummyClassA.php | 8 +- test/Writer/TestAssets/DummyClassB.php | 8 +- test/Writer/TestAssets/DummyWriter.php | 8 +- test/Writer/TestAssets/PhpReader.php | 8 +- test/Writer/XmlTest.php | 8 +- test/Writer/YamlTest.php | 8 +- test/WriterPluginManagerCompatibilityTest.php | 8 +- 54 files changed, 488 insertions(+), 254 deletions(-) create mode 100644 .docheader diff --git a/.docheader b/.docheader new file mode 100644 index 00000000..5602c914 --- /dev/null +++ b/.docheader @@ -0,0 +1,5 @@ +/** + * @see https://github.com/zendframework/zend-config for the canonical source repository + * @copyright Copyright (c) %regexp:(20\d{2}-)?20\d{2}% Zend Technologies USA Inc. (http://www.zend.com) + * @license https://github.com/zendframework/zend-config/blob/master/LICENSE.md New BSD License + */ diff --git a/.travis.yml b/.travis.yml index 0723966f..b6f7886c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -80,6 +80,7 @@ install: script: - if [[ $TEST_COVERAGE == 'true' ]]; then composer test-coverage ; else composer test ; fi - if [[ $CHECK_CS == 'true' ]]; then composer cs-check ; fi + - if [[ $CHECK_CS == 'true' ]]; then composer license-check ; fi - if [[ $DEPLOY_DOCS == "true" && "$TRAVIS_TEST_RESULT" == "0" ]]; then travis_retry curl -sSL https://raw.githubusercontent.com/zendframework/zf-mkdoc-theme/master/theme-installer.sh | bash ; fi after_script: diff --git a/composer.json b/composer.json index ad0b19f3..c3f0933a 100644 --- a/composer.json +++ b/composer.json @@ -18,12 +18,13 @@ "psr/container": "^1.0" }, "require-dev": { + "zendframework/zend-coding-standard": "~1.0.0", "zendframework/zend-filter": "^2.7.1", "zendframework/zend-i18n": "^2.7.3", "zendframework/zend-json": "^2.6.1 || ^3.0", "zendframework/zend-servicemanager": "^2.7.8 || ^3.2.1", - "phpunit/phpunit": "^5.7 || ^6.0", - "zendframework/zend-coding-standard": "~1.0.0" + "malukenho/docheader": "^0.1.5", + "phpunit/phpunit": "^5.7 || ^6.0" }, "conflict": { "container-interop/container-interop": "<1.2.0" @@ -49,11 +50,14 @@ }, "scripts": { "check": [ + "@license-check", "@cs-check", "@test" ], "cs-check": "phpcs", "cs-fix": "phpcbf", + "license-check": "docheader check src/", + "license-check-all": "docheader check src/ test/", "test": "phpunit --colors=always", "test-coverage": "phpunit --colors=always --coverage-clover clover.xml", "upload-coverage": "coveralls -v" diff --git a/composer.lock b/composer.lock index 33137bf6..f7da4cf7 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": "fa26bef60e1134caa7ec23ef7cea5bf1", + "content-hash": "501cc22b3c7da729258998bb2e73b950", "packages": [ { "name": "psr/container", @@ -187,6 +187,56 @@ ], "time": "2015-06-14T21:17:01+00:00" }, + { + "name": "malukenho/docheader", + "version": "0.1.5", + "source": { + "type": "git", + "url": "https://github.com/malukenho/docheader.git", + "reference": "f35ada934d1de3f5ba09970a6541009a41347658" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/malukenho/docheader/zipball/f35ada934d1de3f5ba09970a6541009a41347658", + "reference": "f35ada934d1de3f5ba09970a6541009a41347658", + "shasum": "" + }, + "require": { + "php": "~5.5|^7.0", + "symfony/console": "~2.0|^3.0", + "symfony/finder": "~2.0|^3.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.7" + }, + "bin": [ + "bin/docheader" + ], + "type": "library", + "autoload": { + "psr-4": { + "DocHeader\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jefersson Nathan", + "email": "malukenho@phpse.net" + } + ], + "description": "A small library to check header docs", + "homepage": "https://github.com/malukenho/docheader", + "keywords": [ + "Code style", + "code standard", + "license" + ], + "time": "2016-11-17T16:46:05+00:00" + }, { "name": "myclabs/deep-copy", "version": "1.6.0", @@ -822,6 +872,53 @@ ], "time": "2017-02-02T10:36:38+00:00" }, + { + "name": "psr/log", + "version": "1.0.2", + "source": { + "type": "git", + "url": "https://github.com/php-fig/log.git", + "reference": "4ebe3a8bf773a19edfe0a84b6585ba3d401b724d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/log/zipball/4ebe3a8bf773a19edfe0a84b6585ba3d401b724d", + "reference": "4ebe3a8bf773a19edfe0a84b6585ba3d401b724d", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Log\\": "Psr/Log/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Common interface for logging libraries", + "homepage": "https://github.com/php-fig/log", + "keywords": [ + "log", + "psr", + "psr-3" + ], + "time": "2016-10-10T12:19:37+00:00" + }, { "name": "sebastian/code-unit-reverse-lookup", "version": "1.0.0", @@ -1413,6 +1510,234 @@ ], "time": "2017-02-02T03:30:00+00:00" }, + { + "name": "symfony/console", + "version": "v3.2.3", + "source": { + "type": "git", + "url": "https://github.com/symfony/console.git", + "reference": "7a8405a9fc175f87fed8a3c40856b0d866d61936" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/console/zipball/7a8405a9fc175f87fed8a3c40856b0d866d61936", + "reference": "7a8405a9fc175f87fed8a3c40856b0d866d61936", + "shasum": "" + }, + "require": { + "php": ">=5.5.9", + "symfony/debug": "~2.8|~3.0", + "symfony/polyfill-mbstring": "~1.0" + }, + "require-dev": { + "psr/log": "~1.0", + "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": "3.2-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Console\\": "" + }, + "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 Console Component", + "homepage": "https://symfony.com", + "time": "2017-02-06T12:04:21+00:00" + }, + { + "name": "symfony/debug", + "version": "v3.2.3", + "source": { + "type": "git", + "url": "https://github.com/symfony/debug.git", + "reference": "b4d9818f127c60ce21ed62c395da7df868dc8477" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/debug/zipball/b4d9818f127c60ce21ed62c395da7df868dc8477", + "reference": "b4d9818f127c60ce21ed62c395da7df868dc8477", + "shasum": "" + }, + "require": { + "php": ">=5.5.9", + "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.2-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Debug\\": "" + }, + "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 Debug Component", + "homepage": "https://symfony.com", + "time": "2017-01-28T02:37:08+00:00" + }, + { + "name": "symfony/finder", + "version": "v3.2.3", + "source": { + "type": "git", + "url": "https://github.com/symfony/finder.git", + "reference": "8c71141cae8e2957946b403cc71a67213c0380d6" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/finder/zipball/8c71141cae8e2957946b403cc71a67213c0380d6", + "reference": "8c71141cae8e2957946b403cc71a67213c0380d6", + "shasum": "" + }, + "require": { + "php": ">=5.5.9" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.2-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Finder\\": "" + }, + "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 Finder Component", + "homepage": "https://symfony.com", + "time": "2017-01-02T20:32:22+00:00" + }, + { + "name": "symfony/polyfill-mbstring", + "version": "v1.3.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-mbstring.git", + "reference": "e79d363049d1c2128f133a2667e4f4190904f7f4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/e79d363049d1c2128f133a2667e4f4190904f7f4", + "reference": "e79d363049d1c2128f133a2667e4f4190904f7f4", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "suggest": { + "ext-mbstring": "For best performance" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.3-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Mbstring\\": "" + }, + "files": [ + "bootstrap.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for the Mbstring extension", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "mbstring", + "polyfill", + "portable", + "shim" + ], + "time": "2016-11-14T01:06:16+00:00" + }, { "name": "webmozart/assert", "version": "1.2.0", diff --git a/src/AbstractConfigFactory.php b/src/AbstractConfigFactory.php index 4b574402..0b4cf4bc 100644 --- a/src/AbstractConfigFactory.php +++ b/src/AbstractConfigFactory.php @@ -1,10 +1,8 @@ - * @link http://github.com/zendframework/zf2 for the canonical source repository - * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) - * @license http://framework.zend.com/license/new-bsd New BSD License + * @see https://github.com/zendframework/zend-config for the canonical source repository + * @copyright Copyright (c) 2005-2017 Zend Technologies USA Inc. (http://www.zend.com) + * @license https://github.com/zendframework/zend-config/blob/master/LICENSE.md New BSD License */ namespace ZendTest\Config; diff --git a/test/ConfigTest.php b/test/ConfigTest.php index 3e79623f..1357d57d 100644 --- a/test/ConfigTest.php +++ b/test/ConfigTest.php @@ -1,10 +1,8 @@