Skip to content

Different reports to the same code #115

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

Closed
celorodovalho opened this issue Jun 20, 2019 · 2 comments
Closed

Different reports to the same code #115

celorodovalho opened this issue Jun 20, 2019 · 2 comments
Labels
bug Something isn't working waiting for feedback Additional explanation needed

Comments

@celorodovalho
Copy link

Steps to reproduce

I installed the dependency through the command:
composer require --dev magento/magento-coding-standard

Then I executed the command:
./vendor/bin/phpcs --standard=Magento2 /path/to/file/MassDelete.php

And I got the following result:

FILE: /path/to/file/MassDelete.php
--------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
--------------------------------------------------------------------------------------------------------------
 27 | WARNING | Use ::class notation instead.
--------------------------------------------------------------------------------------------------------------

Time: 1.02 secs; Memory: 8MB

However, on another computer, performing the same procedure, the following result is displayed:

FILE: /path/to/file/MassDelete.php
---------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 3 WARNINGS AFFECTING 3 LINES
---------------------------------------------------------------------------------------------------------------
 27 | WARNING | The direct use of ObjectManager is discouraged. Inject necessary dependencies via constructor.
 28 | WARNING | Model LSD method load() detected in loop
 29 | WARNING | Model LSD method delete() detected in loop
---------------------------------------------------------------------------------------------------------------

Expected result

  1. The same result in both environments
  2. Actually, how to validate LSD/loop and "direct use of ObjectManager" once there is no Sniff for that in the current version?

Actual result

  1. Different results
  2. How can I have 2 different results for the same command in different computers?
@celorodovalho celorodovalho added the bug Something isn't working label Jun 20, 2019
@lenaorobei
Copy link
Contributor

Hello @celorodovalho. Looks like you are using different coding standards on another computer and I suspect it's magento/marketplace-eqp.

Could you please run ./vendor/bin/phpcs -i on both computers and show the output?

@lenaorobei lenaorobei added the waiting for feedback Additional explanation needed label Jun 20, 2019
@lenaorobei
Copy link
Contributor

Closing this issue due to inactivity.
@celorodovalho, feel free to create the new one in case of any issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working waiting for feedback Additional explanation needed
Projects
None yet
Development

No branches or pull requests

2 participants