Skip to content

Document all existing rules #154

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

Open
ihor-sviziev opened this issue Oct 30, 2019 · 0 comments
Open

Document all existing rules #154

ihor-sviziev opened this issue Oct 30, 2019 · 0 comments
Labels
enhancement Improvements to existing rules Progress: ready for dev

Comments

@ihor-sviziev
Copy link
Collaborator

ihor-sviziev commented Oct 30, 2019

Description

As a developer I develop some code and running magento coding standard static tests against my code. But it's not clear what to do in case of some issue.

Example:

PHP Code Sniffer detected 2 violation(s): 

FILE: .../app/code/Magento/Checkout/Model/TotalsInformationManagement.php
----------------------------------------------------------------------
FOUND 4 ERRORS AFFECTING 4 LINES
----------------------------------------------------------------------
 41 | ERROR | [x] If the @inheritdoc not inline it shouldn’t have
    |       |     braces
 43 | ERROR | [x] {@inheritdoc} does not import parameter annotation
 65 | ERROR | [x] Missing short description
 66 | ERROR | [x] There must be exactly one blank line before tags
----------------------------------------------------------------------
PHPCBF CAN FIX THE 4 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------



Failed asserting that 2 matches expected 0.

Let's imaging I'm just first time created some PR to magento2 and got these issues, I don't really know what to do with following things:

  • If the @inheritdoc not inline it shouldn’t have braces
  • {@inheritdoc} does not import parameter annotation
  • Missing short description

I didn't even knew how to run these static tests, as they were ran on some Magento infra and shown me just result (commands that I could run is not shown anywhere) --> I don't know how to run this phpcbf.

So I'm trying to google these things, but just googling of these reports isn't getting any valid result:
https://www.google.com/search?q=If+the+%40inheritdoc+not+inline+it+shouldn%27t+have+braces+magento2
https://www.google.com/search?q=%7B%40inheritdoc%7D+does+not+import+parameter+annotation+magento2
https://www.google.com/search?q=Missing+short+description+magento2

Only one "There must be exactly one blank line before tags" is quite clear.

This is just example of things that quite obvious.

Let's imaging that should I do in case if i'll get following message: The use of function pathinfo() is discouraged and I didn't even touched the place that was using this function (related to #102).

It will be absolutely not clear.

Proposal

@ihor-sviziev ihor-sviziev added the enhancement Improvements to existing rules label Oct 30, 2019
magento-devops-reposync-svc pushed a commit that referenced this issue Feb 11, 2022
…gento-coding-standard-370

[Imported] Removed obsolete layout check
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Improvements to existing rules Progress: ready for dev
Projects
None yet
Development

No branches or pull requests

1 participant