From bd82c97e7787094eeb811652f2410da6a47902f2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stephan=20Hochd=C3=B6rfer?= Date: Sat, 29 May 2021 13:15:05 +0200 Subject: [PATCH] Add license checker to CI workflow --- .allowed-licenses | 4 ++ .github/workflows/ci.yml | 3 + composer.json | 14 +++-- composer.lock | 126 ++++++++++++++++++++++++++++++++++++++- 4 files changed, 140 insertions(+), 7 deletions(-) create mode 100644 .allowed-licenses diff --git a/.allowed-licenses b/.allowed-licenses new file mode 100644 index 0000000..3c9b5a6 --- /dev/null +++ b/.allowed-licenses @@ -0,0 +1,4 @@ +- Apache-2.0 +- BSD-2-Clause +- BSD-3-Clause +- MIT diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b7187f0..0e32add 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -52,6 +52,9 @@ jobs: composer require --prefer-lowest captainhook/captainhook composer require --prefer-lowest --dev captainhook/plugin-composer bitexpert/captainhook-infection + - name: Composer license check + run: composer check-license + - name: Codesniffer run: composer cs-check diff --git a/composer.json b/composer.json index 2e9c70e..a48ee0f 100644 --- a/composer.json +++ b/composer.json @@ -15,15 +15,16 @@ "captainhook/captainhook": "^5.10" }, "require-dev": { + "bitexpert/captainhook-infection": "^0.5.0", "captainhook/plugin-composer": "^5.3.1", - "phpunit/phpunit": "^9.5", - "squizlabs/php_codesniffer": "^3.6", - "phpstan/phpstan": "^0.12", - "roave/security-advisories": "dev-latest", "infection/infection": "^0.21.0", - "bitexpert/captainhook-infection": "^0.5.0", + "madewithlove/license-checker": "^0.10.0", + "phly/keep-a-changelog": "^2.11", + "phpstan/phpstan": "^0.12", "phpstan/phpstan-strict-rules": "^0.12.9", - "phly/keep-a-changelog": "^2.11" + "phpunit/phpunit": "^9.5", + "roave/security-advisories": "dev-latest", + "squizlabs/php_codesniffer": "^3.6" }, "autoload": { "psr-4": { @@ -42,6 +43,7 @@ ], "cs-check": "vendor/bin/phpcs --standard=PSR2 ./src ./tests", "cs-fix": "vendor/bin/phpcbf", + "check-license": "vendor/bin/license-checker check", "analyze": "vendor/bin/phpstan analyze", "test": "vendor/bin/phpunit", "infection": "vendor/bin/infection -j4 --ignore-msi-with-no-mutations --only-covered", diff --git a/composer.lock b/composer.lock index ac357e1..1c28fd7 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": "d7163b88e6673900a6bfdeed5acc00b8", + "content-hash": "851441ebce5540e4eba1736a18c84c49", "packages": [ { "name": "captainhook/captainhook", @@ -2332,6 +2332,55 @@ ], "time": "2021-03-27T23:40:20+00:00" }, + { + "name": "madewithlove/license-checker", + "version": "v0.10.0", + "source": { + "type": "git", + "url": "https://github.com/madewithlove/license-checker-php.git", + "reference": "53837b3f53a207d5b0ef7c86ef3668f2f5005a05" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/madewithlove/license-checker-php/zipball/53837b3f53a207d5b0ef7c86ef3668f2f5005a05", + "reference": "53837b3f53a207d5b0ef7c86ef3668f2f5005a05", + "shasum": "" + }, + "require": { + "symfony/console": "^4.0 || ^5.0", + "symfony/process": "^4.0 || ^5.0", + "symfony/yaml": "^4.0 || ^5.0" + }, + "require-dev": { + "phpunit/phpunit": "^8.5 || ^9.0", + "vimeo/psalm": "^3.9" + }, + "bin": [ + "bin/license-checker" + ], + "type": "library", + "autoload": { + "psr-4": { + "LicenseChecker\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "madewithlove", + "email": "hello@madewithlove.com" + } + ], + "description": "CLI tool to verify allowed licenses for composer dependencies", + "support": { + "issues": "https://github.com/madewithlove/license-checker-php/issues", + "source": "https://github.com/madewithlove/license-checker-php/tree/v0.10.0" + }, + "time": "2020-06-11T11:00:51+00:00" + }, { "name": "myclabs/deep-copy", "version": "1.10.2", @@ -6197,6 +6246,81 @@ ], "time": "2021-01-27T12:56:27+00:00" }, + { + "name": "symfony/yaml", + "version": "v5.2.9", + "source": { + "type": "git", + "url": "https://github.com/symfony/yaml.git", + "reference": "d23115e4a3d50520abddccdbec9514baab1084c8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/yaml/zipball/d23115e4a3d50520abddccdbec9514baab1084c8", + "reference": "d23115e4a3d50520abddccdbec9514baab1084c8", + "shasum": "" + }, + "require": { + "php": ">=7.2.5", + "symfony/deprecation-contracts": "^2.1", + "symfony/polyfill-ctype": "~1.8" + }, + "conflict": { + "symfony/console": "<4.4" + }, + "require-dev": { + "symfony/console": "^4.4|^5.0" + }, + "suggest": { + "symfony/console": "For validating YAML files using the lint command" + }, + "bin": [ + "Resources/bin/yaml-lint" + ], + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\Yaml\\": "" + }, + "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": "Loads and dumps YAML files", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/yaml/tree/v5.2.9" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2021-05-16T13:07:46+00:00" + }, { "name": "thecodingmachine/safe", "version": "v1.3.3",