Skip to content

Move phpcs checks from magento2 to magento-coding-standard repo #209

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

Merged
merged 10 commits into from
Jul 30, 2021

Conversation

loginesta
Copy link
Contributor

https://jira.corp.magento.com/browse/AC-201 Move phpcs checks from magento2 to magento-coding-standard repo

Copy link
Member

@sivaschenko sivaschenko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR @loginesta .

The remaining work would be:

  • Fix all the failing tests
  • Add all the rules from the rulesets specified in the comments

@@ -580,4 +580,13 @@
<severity>5</severity>
<type>warning</type>
</rule>
<rule ref="Magento2.Annotation">
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These ones are already there, EndFileNewline, LineEndings and DisallowTabIndent.
Just adding the ones missing

Copy link
Collaborator

@ihor-sviziev ihor-sviziev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @loginesta,
Could you also cover your change with tests?

- Add other rules from previous ruleset files on Magento
@sivaschenko
Copy link
Member

@ihor-sviziev we are moving a bulk of tests from magento2 repository to magento-testing-coverage (that is the first part). Considering the volume of tests to be moved, limited resources and missing test coverage on magento2 repository we would like to deffer test coverage for the Sniffs moved from magento2 in bulk.

Copy link
Collaborator

@ihor-sviziev ihor-sviziev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can try like this

@@ -128,8 +128,7 @@ private function getArgumentListClosePointer($openParenthesisPointer, array $tok
}

/**
* Seeks the next available {@link T_OPEN_PARENTHESIS} token that comes directly after <var>$stackPointer</var>.
* token.
* Seeks the next available {@link T_OPEN_PARENTHESIS} token that comes directly after <var>$stackPointer</var> token.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* Seeks the next available {@link T_OPEN_PARENTHESIS} token that comes directly after <var>$stackPointer</var> token.
* Find the argument list open pointer
*
* Seeks the next available {@link T_OPEN_PARENTHESIS} token
* that comes directly after <var>$stackPointer</var> token.

Copy link
Collaborator

@ihor-sviziev ihor-sviziev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And like this

@@ -68,8 +68,7 @@ public function process(File $phpcsFile, $stackPtr)
}

/**
* Seeks the next available token of type {@link T_CLOSE_CURLY_BRACKET} in <var>$tokens</var> and returns its
* pointer.
* Seeks the next available token of type {@link T_CLOSE_CURLY_BRACKET} in <var>$tokens</var> and returns its pointer.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* Seeks the next available token of type {@link T_CLOSE_CURLY_BRACKET} in <var>$tokens</var> and returns its pointer.
* Find the closing curly bracket pointer
*
* Seeks the next available token of type {@link T_CLOSE_CURLY_BRACKET}
* in <var>$tokens</var> and returns its pointer.

@@ -81,10 +80,9 @@ private function getClosingCurlyBracketPointer($startPointer, array $tokens)
}

/**
* Seeks the next available token of type {@link T_OPEN_CURLY_BRACKET} in <var>$tokens</var> and returns its
* pointer.
* Seeks the next available token of type {@link T_OPEN_CURLY_BRACKET} in <var>$tokens</var> and returns its pointer.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* Seeks the next available token of type {@link T_OPEN_CURLY_BRACKET} in <var>$tokens</var> and returns its pointer.
* Find the opening curly bracket pointer
*
* Seeks the next available token of type {@link T_OPEN_CURLY_BRACKET}
* in <var>$tokens</var> and returns its pointer.

@loginesta loginesta marked this pull request as ready for review July 30, 2021 11:29
@loginesta loginesta closed this Jul 30, 2021
@loginesta loginesta reopened this Jul 30, 2021
Copy link
Member

@sivaschenko sivaschenko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Test coverage and rules properties in ruleset.xml to follow

@sivaschenko
Copy link
Member

@magento import pr to magento-commerce/magento-coding-standard

@magento-engcom-team
Copy link
Contributor

@sivaschenko the pull request successfully imported.

@magento-devops-reposync-svc magento-devops-reposync-svc merged commit 8deeced into magento:develop Jul 30, 2021
@loginesta loginesta deleted the AC-201 branch September 6, 2021 11:09
magento-devops-reposync-svc pushed a commit that referenced this pull request Mar 30, 2023
…o-coding-standard-438

[Imported] Auto-fix `Magento2.PHP.ShortEchoSyntax.ShortEchoTag`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants