-
Notifications
You must be signed in to change notification settings - Fork 9.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Removed a fixed version phpcs dependency from the project #35807
Removed a fixed version phpcs dependency from the project #35807
Conversation
Hi @bgorski. Thank you for your contribution
❗ Automated tests can be triggered manually with an appropriate comment:
You can find more information about the builds here ℹ️ Run only required test builds during development. Run all test builds before sending your pull request for review. For more details, review the Magento Contributor Guide documentation. 🕙 You can find the schedule on the Magento Community Calendar page. 📞 The triage of Pull Requests happens in the queue order. If you want to speed up the delivery of your contribution, join the Community Contributions Triage session to discuss the appropriate ticket. ✏️ Feel free to post questions/proposals/feedback related to the Community Contributions Triage process to the corresponding Slack Channel |
@magento run all tests |
The requested builds are added to the queue. You should be able to see them here within a few minutes. Please re-request them if they don't show in a reasonable amount of time. |
@magento run all tests |
The requested builds are added to the queue. You should be able to see them here within a few minutes. Please re-request them if they don't show in a reasonable amount of time. |
@magento run Functional Tests B2B, Functional Tests EE, Functional Tests CE |
The requested builds are added to the queue. You should be able to see them here within a few minutes. Please re-request them if they don't show in a reasonable amount of time. |
@magento create issue |
@magento run all tests |
The requested builds are added to the queue. You should be able to see them here within a few minutes. Please re-request them if they don't show in a reasonable amount of time. |
@magento run Functional Tests EE, Functional Tests B2B |
The requested builds are added to the queue. You should be able to see them here within a few minutes. Please re-request them if they don't show in a reasonable amount of time. |
1 similar comment
The requested builds are added to the queue. You should be able to see them here within a few minutes. Please re-request them if they don't show in a reasonable amount of time. |
@magento run Functional Tests B2B |
The requested builds are added to the queue. You should be able to see them here within a few minutes. Please re-request them if they don't show in a reasonable amount of time. |
1 similar comment
The requested builds are added to the queue. You should be able to see them here within a few minutes. Please re-request them if they don't show in a reasonable amount of time. |
@magento run Functional Tests EE, Functional Tests B2B |
The requested builds are added to the queue. You should be able to see them here within a few minutes. Please re-request them if they don't show in a reasonable amount of time. |
@magento run Functional Tests EE, Functional Tests B2B |
The requested builds are added to the queue. You should be able to see them here within a few minutes. Please re-request them if they don't show in a reasonable amount of time. |
1 similar comment
The requested builds are added to the queue. You should be able to see them here within a few minutes. Please re-request them if they don't show in a reasonable amount of time. |
@magento run Functional Tests B2B |
The requested builds are added to the queue. You should be able to see them here within a few minutes. Please re-request them if they don't show in a reasonable amount of time. |
@magento run all tests |
The requested builds are added to the queue. You should be able to see them here within a few minutes. Please re-request them if they don't show in a reasonable amount of time. |
Description (*)
This Pull Request removes a PHP Code Sniffer fixed version dependency from the project's main composer.json file.
The reason for that is for purposes of maintaining a Magento 2 project's code quality, phpcs alone is almost useless. M2 has its own phpcs coding standard, which should be used, and which (obviously) also lists phpcs among its dependencies. The coding standard is also included in the project's main composer.json file so can be considered an integral part of the platform. The coding standard is also the only part of the platform that developers working on Magento projects will use phpcs with.
We should also assume that if any Magento 2 project should use a different coding standard, that coding standard will also list phpcs among its dependencies.
Therefore, the conclusion is that Magento2 itself should NOT manage PHP Code Sniffer's version. It should only be managed by the installed coding standard.
At the point of writing this text, if you remove phpcs from composer.json manually and you run the following command:
composer require magento/magento-coding-standard --dev --ignore-platform-reqs --with-dependencies
The output will contain this:
This means that - for no reason - the main composer.json file prohibits the coding standard from using the latest phpcs version with which it was already marked as compatible.
Additionally, keeping that version there limits the extensibility. For example, if you choose to use the MRM Coding Standard (which also requires and uses the Magento Coding Standard), you need to manually remove the phpcs from the main composer.json before you run the following command:
composer require mrm-commerce/magento-coding-standard-phpcs:3.0.0-RC1 --dev --ignore-platform-reqs --with-dependencies
That's because it requires phpcs version to be at least 3.7.1, which is compatible with Magento Coding Standard, but not with the version required by the main composer.json.
So again, there is no reason for limiting 3rd party coding standards from being used when they're 100% compatible with the Magento Coding Standard.
Manual testing scenarios (*)
composer require magento/magento-coding-standard --dev --ignore-platform-reqs --with-dependencies
Contribution checklist (*)
Resolved issues: