From 2b9460372da3883213a154186e7f78bd7960ea38 Mon Sep 17 00:00:00 2001 From: Franck Nijhof Date: Wed, 16 Aug 2017 11:49:39 +0200 Subject: [PATCH 1/4] Update of README.md corrected all link to our new website. --- README.md | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index 1463dabb..464871ea 100644 --- a/README.md +++ b/README.md @@ -36,15 +36,15 @@ Basically this plugin executes the following steps: - Matching packages and the project itself are scanned for PHP_CodeSniffer rulesets. - The plugin will call PHP_CodeSniffer and configure the `installed_paths` option. -### Calling the plugin directly +### Calling the plugin directly -In some circumstances it is desirable to call this plugin's functionality +In some circumstances it is desirable to call this plugin's functionality directly. For instance, during development or in [CI][definition-ci] environments. As the plugin requires Composer to work, direct calls need to be wired through a project's `composer.json`. -This is done by adding a call to the `Plugin::run` function in the `script` +This is done by adding a call to the `Plugin::run` function in the `script` section of the `composer.json`: ```json @@ -58,7 +58,7 @@ section of the `composer.json`: ``` -The command can then be called using `composer run-script install-codestandards` or +The command can then be called using `composer run-script install-codestandards` or referenced from other script configurations, as follows: ```json @@ -75,13 +75,13 @@ referenced from other script configurations, as follows: ``` -For more details about Composer scripts, please refer to [the section on scripts +For more details about Composer scripts, please refer to [the section on scripts in the Composer manual][composer-manual-scripts]. ### Caveats -When this plugin is installed globally, composer will load the _global_ plugin rather -than the one from the local repository. Despite [this behaviour being documented +When this plugin is installed globally, composer will load the _global_ plugin rather +than the one from the local repository. Despite [this behaviour being documented in the composer manual][using-composer-plugins], it could potentially cause confusion as an version of the plugin could be run other than the version specified by the project. @@ -138,7 +138,7 @@ Then please be sure to check out [our vacancies][vacancies]. Did not find a matching vacancy? Just [get in touch][get-in-touch]! -[workingatdealerdirect.eu][workingatdealerdirecteu] +[dealerdirect.com][dealerdirectcom] ## License @@ -166,14 +166,15 @@ THE SOFTWARE. [awesome-shield]: https://img.shields.io/badge/awesome%3F-yes-brightgreen.svg [changelog]: https://github.com/DealerDirect/phpcodesniffer-composer-installer/releases -[composer]: https://getcomposer.org/ -[composer-manual-scripts]: https://getcomposer.org/doc/articles/scripts.md [codesniffer]: https://github.com/squizlabs/PHP_CodeSniffer +[composer-manual-scripts]: https://getcomposer.org/doc/articles/scripts.md +[composer]: https://getcomposer.org/ [contributing-guidelines]: CONTRIBUTING.md [contributors]: https://github.com/dealerdirect/phpcodesniffer-composer-installer/graphs/contributors +[dealerdirectcom]: http://www.dealerdirect.com/en [definition-ci]: https://en.wikipedia.org/wiki/Continuous_integration [frenck]: https://github.com/frenck -[get-in-touch]: http://workingatdealerdirect.eu/open-sollicitatie/ +[get-in-touch]: https://www.dealerdirect.com/en/contact [license-shield]: https://img.shields.io/github/license/dealerdirect/phpcodesniffer-composer-installer.svg [maintenance-shield]: https://img.shields.io/maintenance/yes/2017.svg [packagist-shield]: https://img.shields.io/packagist/dt/dealerdirect/phpcodesniffer-composer-installer.svg @@ -187,8 +188,6 @@ THE SOFTWARE. [travis]: https://travis-ci.org/DealerDirect/phpcodesniffer-composer-installer [tutorial]: https://github.com/squizlabs/PHP_CodeSniffer/wiki/Coding-Standard-Tutorial [using-composer-plugins]: https://getcomposer.org/doc/articles/plugins.md#using-plugins -[vacancies]: http://workingatdealerdirect.eu/?post_type=vacancy&s=&department=99 +[vacancies]: https://www.dealerdirect.com/en/vacancies [versioneye-shield]: https://www.versioneye.com/user/projects/580be0d1d65a7716b613a790/badge.svg [versioneye]: https://www.versioneye.com/user/projects/580be0d1d65a7716b613a790 -[workingatdealerdirecteu]: http://www.workingatdealerdirect.eu - From 380114334dbdc0409637adec7851287bb2947753 Mon Sep 17 00:00:00 2001 From: Franck Nijhof Date: Wed, 16 Aug 2017 11:56:50 +0200 Subject: [PATCH 2/4] Update README, add example project --- README.md | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/README.md b/README.md index 464871ea..a40a299b 100644 --- a/README.md +++ b/README.md @@ -36,6 +36,34 @@ Basically this plugin executes the following steps: - Matching packages and the project itself are scanned for PHP_CodeSniffer rulesets. - The plugin will call PHP_CodeSniffer and configure the `installed_paths` option. +### Example project + +The following is an example Composer project and has included +multiple `phpcodesniffer-standard` packages. + +```json +{ + "name": "dealerdirect/example-project", + "description": "Just an example project", + "type": "project", + "require": {}, + "require-dev": { + "dealerdirect/phpcodesniffer-composer-installer": "*", + "wimg/php-compatibility": "*", + "wp-coding-standards/wpcs": "*", + "object-calisthenics/phpcs-calisthenics-rules": "*" + } +} +``` + +After running `composer install` PHP_CodeSniffer just works: + +```bash +$ ./vendor/bin/phpcs -i +The installed coding standards are MySource, PEAR, PSR1, PSR2, Squiz, Zend, PHPCompatibility, WordPress, +WordPress-Core, WordPress-Docs, WordPress-Extra and WordPress-VIP +``` + ### Calling the plugin directly In some circumstances it is desirable to call this plugin's functionality From 4f81ae3a231f2a1c7e4f73d27165d6fba906fb53 Mon Sep 17 00:00:00 2001 From: Franck Nijhof Date: Wed, 16 Aug 2017 12:04:26 +0200 Subject: [PATCH 3/4] Update README, some minor wording / typos --- README.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index a40a299b..a93605f7 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,7 @@ This composer installer plugin allows for easy installation of [PHP_CodeSniffer][codesniffer] coding standards (rulesets). -No more symbolic linking of directories, checking out repositories on specific locations and/or changing +No more symbolic linking of directories, checking out repositories on specific locations or changing the `phpcs` configuration. _Note: This plugin is compatible with both version 2.x and 3.x of_ [PHP_CodeSniffer][codesniffer] @@ -30,7 +30,7 @@ That's it. ### How it works -Basically this plugin executes the following steps: +Basically, this plugin executes the following steps: - This plugin search for `phpcodesniffer-standard` packages in all of your currently installed Composer packages. - Matching packages and the project itself are scanned for PHP_CodeSniffer rulesets. @@ -66,7 +66,7 @@ WordPress-Core, WordPress-Docs, WordPress-Extra and WordPress-VIP ### Calling the plugin directly -In some circumstances it is desirable to call this plugin's functionality +In some circumstances, it is desirable to call this plugin's functionality directly. For instance, during development or in [CI][definition-ci] environments. As the plugin requires Composer to work, direct calls need to be wired through a @@ -109,9 +109,9 @@ in the Composer manual][composer-manual-scripts]. ### Caveats When this plugin is installed globally, composer will load the _global_ plugin rather -than the one from the local repository. Despite [this behaviour being documented -in the composer manual][using-composer-plugins], it could potentially cause confusion -as an version of the plugin could be run other than the version specified by the project. +than the one from the local repository. Despite [this behavior being documented +in the composer manual][using-composer-plugins], it could potentially confuse +as an other version of the plugin could be run and not the one specified by the project. ## Developing Coding Standards From 78239990a267800a5d0bd70477580e33ee88014b Mon Sep 17 00:00:00 2001 From: Franck Nijhof Date: Wed, 16 Aug 2017 12:16:25 +0200 Subject: [PATCH 4/4] Update README, sort packages in example --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index a93605f7..ccdbd537 100644 --- a/README.md +++ b/README.md @@ -49,9 +49,9 @@ multiple `phpcodesniffer-standard` packages. "require": {}, "require-dev": { "dealerdirect/phpcodesniffer-composer-installer": "*", + "object-calisthenics/phpcs-calisthenics-rules": "*", "wimg/php-compatibility": "*", - "wp-coding-standards/wpcs": "*", - "object-calisthenics/phpcs-calisthenics-rules": "*" + "wp-coding-standards/wpcs": "*" } } ```