Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions .allowed-licenses.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?php

declare(strict_types=1);

use Lendable\ComposerLicenseChecker\LicenseConfigurationBuilder;

return (new LicenseConfigurationBuilder())
->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();
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
vendor
composer.lock
22 changes: 12 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -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"
Expand All @@ -17,19 +16,22 @@ or use the stricter standard
}
```

### PHPCI

## PHPCI
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can just remove this section now.

```
php_code_sniffer:
allowed_warnings: 0
allowed_errors: 0
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/<username>/.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.
5 changes: 4 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,8 @@
"type": "composer",
"url": "https://packages.d3r.com"
}
]
],
"require": {
"lendable/composer-license-checker": "^1.0"
}
}