magento-coding-standard icon indicating copy to clipboard operation
magento-coding-standard copied to clipboard

Cannot switch to latest coding standard

Open unicoder88 opened this issue 1 year ago • 5 comments

Hi!

On Magento 2.4.3, I'm looking to upgrade to latest magento-coding-standard (v25), however, there's a conflict with webonyx/graphql-php.

    "require": {
        "php": ">=7.3",
        "webonyx/graphql-php": "^14.9",

My Magento version is stuck with v0.13.9, so I'm effectively unable to check against up-to-date code styles and stuck with standards v6.

I believe that coding standard should not technically depend on that, and we can safely remove any Magento code version requirements.

Agree?

unicoder88 avatar Jul 10 '22 16:07 unicoder88

Hi @unicoder88. Thank you for your report. To speed up processing of this issue, make sure that you provided sufficient information.

Add a comment to assign the issue: @magento I am working on this


m2-assistant[bot] avatar Jul 10 '22 16:07 m2-assistant[bot]

Having the same issue on version 2.4.3-p2

gowrizrh avatar Aug 08 '22 05:08 gowrizrh

I think that the issue is that the require section of this standard contains a lot of things that should be in require-dev instead.

The standard itself should only require two things:

  • Any version of codesniffer that is compatible with it (the requirement must be as loose as possible)
  • Compatible versions of PHP

guvra avatar Aug 09 '22 15:08 guvra

I think that the issue is that the require section of this standard contains a lot of things that should be in require-dev instead.

I've checked just now and all the packages listed in require are used in the standards, not just its tests.

fredden avatar Aug 10 '22 16:08 fredden

It looks like this is fixed since Magento version 2.4.4.

https://github.com/magento/magento2/blob/2.4.3/composer.json#L82 - "webonyx/graphql-php": "^0.13.8", https://github.com/magento/magento2/blob/2.4.4/composer.json#L86 - "webonyx/graphql-php": "~14.11.3", https://github.com/magento/magento2/blob/2.4.5/composer.json#L81 - "webonyx/graphql-php": "~14.11.6",

https://github.com/magento/magento-coding-standard/blob/v25/composer.json#L12 - "webonyx/graphql-php": "^14.9",

fredden avatar Aug 10 '22 16:08 fredden