diff --git a/CHANGELOG.md b/CHANGELOG.md index 7dbf41e..bbdaa2f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,10 +4,23 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## 2.0.0 +### Added +- Composer package youwe/coding-standard which is now included in the Youwe coding standards for Magento 2. +- Comments for why the ruleset was added. +- Coding standards for phtml templates. +- Package [magento/magento-coding-standard](https://github.com/magento/magento-coding-standard) as a requirement. + The version v25 is used as a base. If not compatible please update the `phpcs.xml` in project root. + +### Removed +- Rule PSR2.Methods.MethodDeclaration.Underscore since this is already excluded by Magento. +- Argument colors and added it in the common Youwe coding standards. +- Old coding ruleset directories and migrated them to YouweMagento2. + ## 1.7.0 - 2021-12-24 ### Changed - Vendor from MediactMagento2 to Magento2 - Copyrights. ### Removed -- Dependency squizlabs/php_codesniffer. \ No newline at end of file +- Dependency squizlabs/php_codesniffer. diff --git a/README.md b/README.md index 9621d7c..b58cb92 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 Magento2 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 -W ``` 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 diff --git a/composer.json b/composer.json index c7d6552..01b3b0f 100644 --- a/composer.json +++ b/composer.json @@ -1,22 +1,29 @@ { "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": "phpcodesniffer-standard", "authors": [ { "name": "Youwe B.V.", "email": "info@youweagency.com" } ], + "homepage": "https://github.com/YouweGit/coding-standard-magento2", "require": { - "youwe/coding-standard": ">=3.3.0" + "dealerdirect/phpcodesniffer-composer-installer": "^0.7.2", + "magento/magento-coding-standard": ">= 9", + "youwe/coding-standard": "^3.5.0" }, "autoload": { "psr-0": { - "MediactMagento2": "src/MediactMagento2", - "Magento2": "src/Magento2" + "YouweMagento2": "src/YouweMagento2" } + }, + "config": { + "allow-plugins": { + "dealerdirect/phpcodesniffer-composer-installer": true + }, + "sort-packages": true } } diff --git a/src/Magento2/ruleset.xml b/src/Magento2/ruleset.xml deleted file mode 100644 index bf45a16..0000000 --- a/src/Magento2/ruleset.xml +++ /dev/null @@ -1,50 +0,0 @@ - - - - Youwe coding standards for Magento2. - - - - - - - - - - - - - - - *.phtml - - - - *.phtml - - - - *.phtml - - - - *.phtml - - - - *.phtml - - - - - - - - - - diff --git a/src/MediactMagento2/phpmd.xml b/src/MediactMagento2/phpmd.xml deleted file mode 100644 index 2f9b695..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 4561c7a..0000000 --- a/src/MediactMagento2/ruleset.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - 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/YouweMagento2/ruleset.xml b/src/YouweMagento2/ruleset.xml new file mode 100644 index 0000000..bb4ba2e --- /dev/null +++ b/src/YouweMagento2/ruleset.xml @@ -0,0 +1,113 @@ + + + + Youwe coding standards for Magento2 websites and modules + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + *.phtml + + + + + *.phtml + + + + + *.phtml + + + + + *.phtml + *.xml + + + + + *.phtml + + + + + *.phtml + + + + + *.phtml + + + + + *.phtml + + + + + *.phtml + + + + + *.phtml + + + + + *.phtml + + + + + *.phtml + + + + + + + + + + + *.phtml + +