YouweGit / testing-suite

Collection of PHP code testing packages.
MIT License
11 stars 9 forks source link

Dependency on mediact modules, but not specified. #25

Closed wahidnory closed 8 months ago

wahidnory commented 8 months ago

Heya,

After requiring the package, it seems that this requires the mediact/coding-standard-magento2, mediact/testing-suite/ and mediact/coding-standard-magento1 for example in vendor/youwe/testing-suite/src/Installer/FilesInstaller.php

[
           './vendor/mediact/coding-standard-magento2/src/MediactMagento2/phpmd.xml',
           './vendor/mediact/coding-standard/src/MediaCT/phpmd.xml',
           './vendor/youwe/coding-standard-magento2/src/Magento2/phpmd.xml'
],

But the mediact package is abandoned, are you guys planning on migrating the coding standards into a youwe package?

If not perhaps it's an idea to include the mediact packages as a required sub dependency?

Would love to hear your thoughts about this.

fredden commented 8 months ago

@wahidnory what error / problem are you experiencing? The lines of code you reference specifically deal with the migration from the mediact/ namespace into youwe/ / this package. As far as I know, the relevant packages are already listed in composer.json here.

wahidnory commented 8 months ago

I think that's the problem, I don't have any migration from mediact, I'm simply requiring the testingsuite without having a mediact package present. And that would mean that you guys are expecting a mediact package which isn't really present.

Because then it errors out on trying to locate the file. Here's the error.

PHP Fatal error:  Uncaught _HumbugBox2e6990dfd7a2\Symfony\Component\Config\Exception\FileLocatorFileNotFoundException: The file "vendor/mediact/testing-suite/config/default/grumphp.yml" does not exist

Should this perhaps be caught and not error out like this?

fredden commented 8 months ago

@wahidnory thanks for providing the error message. What steps do you take to get this? I'd like to get this problem fixed. Can you confirm what version of this package you're using, and any other details that would help me reproduce the issue.

wahidnory commented 8 months ago

@fredden Thanks for your response but it seems that there was a small legacy issue where we still had a couple of mediact packages in allowed-plugins.

After requiring the testings-suite it triggered the error above.

So removing the mediact from allowed-plugins list. Fixes the error.

Sorry to raise an issue about this, seemed like it was on me :sweat_smile:

fredden commented 8 months ago

Great. Thanks for the update. Do you recall (or can you extract from version control) what packages were conflicting / causing the problem? We can probably adjust composer.json files to (try to) avoid this problem going forward.

wahidnory commented 8 months ago

Ah wait one moment, it seems that after getting past composer install, the phpcs is now asking for mediact files.

GrumPHP is sniffing your code!

Running tasks with priority 0!
==============================

Running task 1/1: phpcs... ✘

phpcs
=====

ERROR: Referenced sniff "./vendor/mediact/coding-standard-magento2/src/MediactMagento2" does not exist

Run "phpcs --help" for usage information
To skip commit checks, add -n or --no-verify flag to commit command

There seems to be something still remnant or relevant in the youwe/testing-suite package

Currently we're using the following version.

 "name": "youwe/testing-suite",
 "version": "2.17.1",
fredden commented 8 months ago

@wahidnory please can you provide some instructions for how I can reproduce this? So far I've not been able to get all these errors locally / on my set-up. It sounds like you may have some left-over MediaCT-branded packages / configuration in your project.

wahidnory commented 8 months ago

Ah crap, my bad again :sweat_smile: , as I've opened up the phpcs.xml I find the following line

<rule ref="./vendor/mediact/coding-standard-magento2/src/MediactMagento2"/>

You're completely right and this is all legacy stuff still present.

So I'm missing the coding standard for magento2 https://github.com/YouweGit/coding-standard-magento2

Thank you for your time and energy in trying to figure it out with me :smile: