From 4dd83639bb3cff0b11d7d6f0fdcd4905390e9d22 Mon Sep 17 00:00:00 2001 From: Dan Wallis Date: Mon, 12 Sep 2022 16:44:06 +0100 Subject: [PATCH 1/7] Update branding in documentation --- README.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 9621d7c..717a531 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # Introduction -This is the MediaCT coding standard for Magento 2 projects. It is based on -the default MediaCT coding standard but some tests have been removed to create +This is the Youwe coding standard for Magento 2 projects. It is based on +the default Youwe coding standard but some tests have been removed to create a workable and fast standard. # Installation @@ -9,7 +9,7 @@ a workable and fast standard. Use composer to require the standard in a project. ```shell -composer require --dev mediact/coding-standard-magento2 +composer require --dev youwe/coding-standard-magento2 ``` To let PHPCS know that this standard should be used add a phpcs.xml file in the @@ -18,20 +18,20 @@ root of the project. ```xml - + ``` # Integration with PHPStorm and automatic testing The recommended way to enable the coding standard in PHPStorm and automatic -testing is by requiring the MediaCT testing suite in a project. +testing is by requiring the Youwe testing suite in a project. ```shell -composer require --dev mediact/testing-suite +composer require --dev youwe/testing-suite ``` -For more information go to [MediaCT Testing Suite](https://github.com/mediact/testing-suite). +For more information go to [Youwe Testing Suite](https://github.com/YouweGit/testing-suite). # Contribution guidelines From d25d7712d03bb5f44ba2b092e5251649a53bd183 Mon Sep 17 00:00:00 2001 From: Dan Wallis Date: Mon, 12 Sep 2022 16:47:17 +0100 Subject: [PATCH 2/7] Rename Magento2 coding standard to YouweMagento2 This is to avoid collision with upstream Magento2 coding standard. This is a breaking change and will require a new major version number when it is released. --- README.md | 2 +- composer.json | 2 +- src/MediactMagento2/phpmd.xml | 2 +- src/MediactMagento2/ruleset.xml | 2 +- src/{Magento2 => YouweMagento2}/phpmd.xml | 0 src/{Magento2 => YouweMagento2}/ruleset.xml | 2 +- 6 files changed, 5 insertions(+), 5 deletions(-) rename src/{Magento2 => YouweMagento2}/phpmd.xml (100%) rename src/{Magento2 => YouweMagento2}/ruleset.xml (98%) diff --git a/README.md b/README.md index 717a531..937b3fa 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,7 @@ root of the project. ```xml - + ``` diff --git a/composer.json b/composer.json index c7d6552..bbf4b4c 100644 --- a/composer.json +++ b/composer.json @@ -16,7 +16,7 @@ "autoload": { "psr-0": { "MediactMagento2": "src/MediactMagento2", - "Magento2": "src/Magento2" + "YouweMagento2": "src/YouweMagento2" } } } diff --git a/src/MediactMagento2/phpmd.xml b/src/MediactMagento2/phpmd.xml index 2f9b695..399c9d3 100644 --- a/src/MediactMagento2/phpmd.xml +++ b/src/MediactMagento2/phpmd.xml @@ -13,5 +13,5 @@ xsi:noNamespaceSchemaLocation=" http://pmd.sf.net/ruleset_xml_schema.xsd"> Mediact coding standards for Magento2 is deprecated please use Magento2. - + diff --git a/src/MediactMagento2/ruleset.xml b/src/MediactMagento2/ruleset.xml index 4561c7a..7ad4bf7 100644 --- a/src/MediactMagento2/ruleset.xml +++ b/src/MediactMagento2/ruleset.xml @@ -7,5 +7,5 @@ --> Mediact coding standards for Magento2 is deprecated please use Magento2. - + diff --git a/src/Magento2/phpmd.xml b/src/YouweMagento2/phpmd.xml similarity index 100% rename from src/Magento2/phpmd.xml rename to src/YouweMagento2/phpmd.xml diff --git a/src/Magento2/ruleset.xml b/src/YouweMagento2/ruleset.xml similarity index 98% rename from src/Magento2/ruleset.xml rename to src/YouweMagento2/ruleset.xml index bf45a16..85e708a 100644 --- a/src/Magento2/ruleset.xml +++ b/src/YouweMagento2/ruleset.xml @@ -5,7 +5,7 @@ * https://www.youweagency.com */ --> - + Youwe coding standards for Magento2. From 937105507d2c2484bdeaf2c0f6a2eebfb2ab4322 Mon Sep 17 00:00:00 2001 From: Dan Wallis Date: Mon, 12 Sep 2022 16:49:19 +0100 Subject: [PATCH 3/7] Remove deprecated standards This is feasible as we are releasing the next major version of this pacakge anyway. (See previous commit.) --- composer.json | 1 - src/MediactMagento2/phpmd.xml | 17 ----------------- src/MediactMagento2/ruleset.xml | 11 ----------- 3 files changed, 29 deletions(-) delete mode 100644 src/MediactMagento2/phpmd.xml delete mode 100644 src/MediactMagento2/ruleset.xml diff --git a/composer.json b/composer.json index bbf4b4c..2094f1e 100644 --- a/composer.json +++ b/composer.json @@ -15,7 +15,6 @@ }, "autoload": { "psr-0": { - "MediactMagento2": "src/MediactMagento2", "YouweMagento2": "src/YouweMagento2" } } diff --git a/src/MediactMagento2/phpmd.xml b/src/MediactMagento2/phpmd.xml deleted file mode 100644 index 399c9d3..0000000 --- a/src/MediactMagento2/phpmd.xml +++ /dev/null @@ -1,17 +0,0 @@ - - - - Mediact coding standards for Magento2 is deprecated please use Magento2. - - diff --git a/src/MediactMagento2/ruleset.xml b/src/MediactMagento2/ruleset.xml deleted file mode 100644 index 7ad4bf7..0000000 --- a/src/MediactMagento2/ruleset.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - Mediact coding standards for Magento2 is deprecated please use Magento2. - - From cac15ca929a0c197365557fb08f6bed22bcc07ad Mon Sep 17 00:00:00 2001 From: Dan Wallis Date: Mon, 12 Sep 2022 17:31:06 +0100 Subject: [PATCH 4/7] Import official Magento2 coding standard --- README.md | 2 +- composer.json | 12 ++++++++++++ src/YouweMagento2/ruleset.xml | 19 +++++++++++++------ 3 files changed, 26 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 937b3fa..d007faa 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # Introduction This is the Youwe coding standard for Magento 2 projects. It is based on -the default Youwe coding standard but some tests have been removed to create +the default Magento2 coding standard but some tests have been removed to create a workable and fast standard. # Installation diff --git a/composer.json b/composer.json index 2094f1e..f94b8f1 100644 --- a/composer.json +++ b/composer.json @@ -11,11 +11,23 @@ } ], "require": { + "magento/magento-coding-standard": "*", "youwe/coding-standard": ">=3.3.0" }, "autoload": { "psr-0": { "YouweMagento2": "src/YouweMagento2" } + }, + "scripts": { + "post-install-cmd": [ + "@phpcs-set-paths" + ], + "post-update-cmd": [ + "@phpcs-set-paths" + ], + "phpcs-set-paths": [ + "vendor/bin/phpcs --config-set installed_paths src/,../../magento/magento-coding-standard/,../../phpcompatibility/php-compatibility/" + ] } } diff --git a/src/YouweMagento2/ruleset.xml b/src/YouweMagento2/ruleset.xml index 85e708a..7d7a07f 100644 --- a/src/YouweMagento2/ruleset.xml +++ b/src/YouweMagento2/ruleset.xml @@ -6,22 +6,29 @@ */ --> - Youwe coding standards for Magento2. + Youwe coding standards for Magento2 websites and modules + - - - + - + + + + + + + + + - *.phtml + *.phtml,*.xml From 714920696bfe31b3bec4f19ec376697932c7c399 Mon Sep 17 00:00:00 2001 From: Dan Wallis Date: Mon, 12 Sep 2022 17:31:48 +0100 Subject: [PATCH 5/7] Avoid unbounded version constraints where possible --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index f94b8f1..5bff46b 100644 --- a/composer.json +++ b/composer.json @@ -12,7 +12,7 @@ ], "require": { "magento/magento-coding-standard": "*", - "youwe/coding-standard": ">=3.3.0" + "youwe/coding-standard": "^3.3.0" }, "autoload": { "psr-0": { From d8ef3ffc4ec6898947ec45fe228cb11f03e65e7a Mon Sep 17 00:00:00 2001 From: Dan Wallis Date: Mon, 12 Sep 2022 17:32:16 +0100 Subject: [PATCH 6/7] composer normalize --- composer.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/composer.json b/composer.json index 5bff46b..1be8832 100644 --- a/composer.json +++ b/composer.json @@ -1,15 +1,15 @@ { "name": "youwe/coding-standard-magento2", "description": "Youwe PHP Coding Standard for Magento2", - "type": "phpcs-sniffs", - "homepage": "https://github.com/YouweGit/coding-standard-magento2", "license": "proprietary", + "type": "phpcs-sniffs", "authors": [ { "name": "Youwe B.V.", "email": "info@youweagency.com" } ], + "homepage": "https://github.com/YouweGit/coding-standard-magento2", "require": { "magento/magento-coding-standard": "*", "youwe/coding-standard": "^3.3.0" From f2435713ba5766897413e7ea89e510c7808624c5 Mon Sep 17 00:00:00 2001 From: Dan Wallis Date: Mon, 12 Sep 2022 17:38:40 +0100 Subject: [PATCH 7/7] Correct minimum version of upstream standard --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 1be8832..7ea2e14 100644 --- a/composer.json +++ b/composer.json @@ -12,7 +12,7 @@ "homepage": "https://github.com/YouweGit/coding-standard-magento2", "require": { "magento/magento-coding-standard": "*", - "youwe/coding-standard": "^3.3.0" + "youwe/coding-standard": "^3.5.0" }, "autoload": { "psr-0": {