magento / magento-coding-standard

Magento Coding Standard
Open Software License 3.0
349 stars 153 forks source link

Not able to add magento 2 standard #203

Closed hkvega01 closed 3 years ago

hkvega01 commented 3 years ago

Preconditions

  1. magento 2.3 existing project
  2. codesniff already installed
  3. vendor/magento/magento-coding-standard installed

Steps to reproduce

  1. add "scripts": { "post-install-cmd": [ "([ $COMPOSER_DEV_MODE -eq 0 ] || vendor/bin/phpcs --config-set installed_paths ../../magento/magento-coding-standard/)" ], "post-update-cmd": [ "([ $COMPOSER_DEV_MODE -eq 0 ] || vendor/bin/phpcs --config-set installed_paths ../../magento/magento-coding-standard/)" ] } into composer.json
  2. type vendor/bin/phpcs -i only see he installed coding standards are MySource, PEAR, PSR1, PSR12, PSR2, Squiz and Zend

Expected result

  1. see magento 2 in above command

Actual result

  1. magento 2 standard not included

Did i add the script correctly?

{
    "name": "magento/project-community-edition",
    "description": "eCommerce Platform for Growth (Community Edition)",
    "type": "project",
    "version": "2.2.2",
    "license": [
        "OSL-3.0",
        "AFL-3.0"
    ],
    "require": {
        "magento/product-community-edition": "2.3.4",
        "composer/composer": "@alpha",
        "magento/module-bundle-sample-data": "100.3.*",
        "magento/module-customer-sample-data": "100.3.*",
        "magento/module-sales-sample-data": "100.3.*",
        "magento/module-catalog-sample-data": "100.3.*",
        "magento/module-cms-sample-data": "100.3.*",
        "magento/module-theme-sample-data": "100.3.*",
        "magento/module-widget-sample-data": "100.3.*",
        "magento/module-downloadable-sample-data": "100.3.*",
        "magento/module-wishlist-sample-data": "100.3.*",
        "magento/module-review-sample-data": "100.3.*",
        "magento/module-tax-sample-data": "100.3.*",
        "magento/module-catalog-rule-sample-data": "100.3.*",
        "magento/module-msrp-sample-data": "100.3.*",
        "magento/module-configurable-sample-data": "100.3.*",
        "magento/module-product-links-sample-data": "100.3.*",
        "magento/module-grouped-product-sample-data": "100.3.*",
        "magento/module-sales-rule-sample-data": "100.3.*",
        "magento/module-offline-shipping-sample-data": "100.3.*",
        "magento/module-swatches-sample-data": "100.3.*",
        "magento/sample-data-media": "100.3.*",
        "dvdoug/boxpacker": "^3.4",
        "zendframework/zend-mail": "^2.9.0",
        "cloudflare/cloudflare-magento": "^1.1",
        "cweagans/composer-patches": "^1.6",
        "smile/elasticsuite": "^2.7.0"
    },
    "require-dev": {
        "phpunit/phpunit": "~6.2.0",
        "squizlabs/php_codesniffer": "3.5.8",
        "phpmd/phpmd": "@stable",
        "pdepend/pdepend": "2.5.2",
        "friendsofphp/php-cs-fixer": "~2.10.1",
        "lusitanian/oauth": "~0.8.10",
        "sebastian/phpcpd": "~3.0.0",
        "magento/magento-coding-standard": "^6.0"
    },
    "autoload": {
        "psr-4": {
            "Magento\\Framework\\": "lib/internal/Magento/Framework/",
            "Magento\\Setup\\": "setup/src/Magento/Setup/",
            "Magento\\": "app/code/Magento/",
            "Zend\\Mvc\\Controller\\": "setup/src/Zend/Mvc/Controller/"
        },
        "psr-0": {
            "": [
                "app/code/"
            ]
        },
        "files": [
            "app/etc/NonComposerComponentRegistration.php"
        ],
        "exclude-from-classmap": [
            "**/dev/**",
            "**/update/**",
            "**/Test/**"
        ]
    },
    "autoload-dev": {
        "psr-4": {
            "Magento\\Sniffs\\": "dev/tests/static/framework/Magento/Sniffs/",
            "Magento\\Tools\\": "dev/tools/Magento/Tools/",
            "Magento\\Tools\\Sanity\\": "dev/build/publication/sanity/Magento/Tools/Sanity/",
            "Magento\\TestFramework\\Inspection\\": "dev/tests/static/framework/Magento/TestFramework/Inspection/",
            "Magento\\TestFramework\\Utility\\": "dev/tests/static/framework/Magento/TestFramework/Utility/"
        }
    },
    "minimum-stability": "stable",
    "repositories": {
        "0": {
            "type": "composer",
            "url": "https://repo.magento.com/"
        },
        "mcspronko": {
            "type": "vcs",
            "url": "https://github.com/mcspronko/magento-2-ui-component"
        }
    },
    "extra": {
        "magento-force": "override",
        "composer-exit-on-patch-failure": true
    },
    "scripts": {
        "post-install-cmd": [
            "([ $COMPOSER_DEV_MODE -eq 0 ] || vendor/bin/phpcs --config-set installed_paths ../../magento/magento-coding-standard/)"
        ],
        "post-update-cmd": [
            "([ $COMPOSER_DEV_MODE -eq 0 ] || vendor/bin/phpcs --config-set installed_paths ../../magento/magento-coding-standard/)"
        ]
    }
}
m2-assistant[bot] commented 3 years ago

Hi @hkvega01. Thank you for your report. To help us process this issue please make sure that you provided sufficient information.

Please, add a comment to assign the issue: @magento I am working on this