diff --git a/.allowed-licenses.php b/.allowed-licenses.php new file mode 100644 index 0000000..6c4a4fc --- /dev/null +++ b/.allowed-licenses.php @@ -0,0 +1,21 @@ +addLicenses( + 'MIT', + 'BSD-2-Clause', + 'BSD-3-Clause', + 'Apache-2.0', + 'LGPL-2.1-only', + 'LGPL-2.1-or-later', + 'LGPL-3.0+', + 'LGPL-3.0-or-later', + 'MPL-2.0', + 'ISC', + ) + ->addAllowedVendor('d3r') // Allow all D3R packages + ->build(); diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..7579f74 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +vendor +composer.lock diff --git a/README.md b/README.md index 0d2a20e..aa0c702 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,9 @@ D3R Coding Standards ========= -### Include in composer - +## Installation ```composer require --dev d3r/standards``` -### PHPCS +## PHPCS ``` "phpcs_additional_args": { "--standard": "vendor/d3r/standards/D3R-PHP.xml" @@ -17,8 +16,7 @@ or use the stricter standard } ``` -### PHPCI - +## PHPCI ``` php_code_sniffer: allowed_warnings: 0 @@ -26,10 +24,14 @@ php_code_sniffer: standard: "vendor/d3r/standards/D3R-PHP.xml" ``` -### Dev environment -For your editor then we have a more strict standard so we can stage changes without breaking all builds -Check these out into your /clients/custom folder. +## Dev environment +For your editor I suggest checking this package out globally: + +`composer global require d3r/standards` + +Then point your editor's phpcs and phpcbf to `/Users//.composer/vendor/d3r/standards/D3R-PHP.xml`. -`git clone https://github.com/D3R/standards /clients/custom/standards` +## Licence Checker +You will automatically get licence checking in CI if you are using the standard D3R GitHub Workflow. -then point your editor's phpci to one of the files either `/clients/custom/standards/D3R-DEV-PHP.xml` or `/clients/custom/standards/D3R-PHP.xml` +If you need to add specific packages, vendors or licences to your local project, you can create a `.allowed-licenses.php` config file using the [base config](./.allowed-licenses.php) as a starting point. diff --git a/composer.json b/composer.json index ec21c37..58586b7 100644 --- a/composer.json +++ b/composer.json @@ -12,5 +12,8 @@ "type": "composer", "url": "https://packages.d3r.com" } - ] + ], + "require": { + "lendable/composer-license-checker": "^1.0" + } }