-
-
Notifications
You must be signed in to change notification settings - Fork 36
Template for use with pull request on custom code sniff projects
To gain more widespread support for PHPCodeSniffer installers (not just this project) it is important that maintainers of custom codesniffs adapt using the "type" : "phpcodesniffer-standard"
in their project's composer.json
.
Opening a pull-request for such a change is trivial. Finding the right words to explain the rationale behind a PR can be more daunting.
Below is a template that can be use ad-verbatim to accompany any PR that add "type" : "phpcodesniffer-standard"
to a projects composer file.
The text below can be selected and copied as-is:
## Problem/Motivation
Composer allows declaring [the type of a package][composer-package-type]. If no
type is declared, the defaults is "library".
There are various [composer plugins][composer-plugin] that can install custom
PHP CodeSniffer standards:
- https://github.com/higidi/composer-phpcodesniffer-standards-plugin
- https://github.com/DealerDirect/phpcodesniffer-composer-installer
- https://github.com/SimplyAdmire/ComposerPlugins
For these installers to work, the package type needs to be set to "phpcodesniffer-standard".
## Proposed changes
Adding the following line to the `composer.json` will make it possible for such packages to install this custom sniff using composer:
```json
"type" : "phpcodesniffer-standard"
```
This will in _no way_ change the existing behaviour of this package for user that do not include one of the packages mentioned above in their projects `composer.json`.
[composer-package-type]: https://getcomposer.org/doc/04-schema.md#type
[composer-plugin]: https://getcomposer.org/doc/articles/plugins.md
The template above will render (more or less) like this:
Composer allows declaring the type of a package. If no type is declared, the defaults is "library".
There are various composer plugins that can install custom PHP CodeSniffer standards:
- https://github.com/higidi/composer-phpcodesniffer-standards-plugin
- https://github.com/DealerDirect/phpcodesniffer-composer-installer
- https://github.com/SimplyAdmire/ComposerPlugins
For these installers to work, the package type needs to be set to "phpcodesniffer-standard".
Adding the following line to the composer.json
will make it possible for such packages to install this custom sniff using composer:
"type" : "phpcodesniffer-standard"
This will in no way change the existing behaviour of this package for user that do not include one of the packages mentioned above in their projects composer.json
.
To the extent possible under law,
Dealerdirect
has waived all copyright and related or neighboring rights to this
"Template for use with pull-request on custom code-sniff projects".