Skip to content
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

Fix code style issues with php-cs-fixer #13270

Conversation

ihor-sviziev
Copy link
Contributor

@ihor-sviziev ihor-sviziev commented Jan 19, 2018

Description

Fixed code style issues with automatic tool.
Executed following commands:

./vendor/bin/php-cs-fixer -vvv fix ./app/code/
./vendor/bin/php-cs-fixer -vvv fix ./lib/internal/

Fixed Issues (if relevant)

N/A

Manual testing scenarios

N/A

Contribution checklist

  • Pull request has a meaningful description of its purpose
  • All commits are accompanied by meaningful commit messages
  • All new or changed code is covered with unit/integration tests (if applicable)
  • All automated tests passed successfully (all builds on Travis CI are green)

@ihor-sviziev ihor-sviziev changed the title Fix code style issues with php-cs-fixer [WIP] Fix code style issues with php-cs-fixer Jan 19, 2018
@ihor-sviziev
Copy link
Contributor Author

Tests are failing, will update code

Fix too long lines issues
Revert interface that was used for tests
Fix too long lines issues
Manually fix static test failures
@ihor-sviziev
Copy link
Contributor Author

After automatic fixes I also applied manual fixes because there were a lot of issues with "too long line" issues. Another issue I faced - phpmd static test runs only for changed files, so some files appeared because they hadn't suppression.

Right now if we're running php-cs-fixer for app/code and lib/internal - we have broken static tests for 9 lines, these files were fixed manually:

magento2/app/code/Magento/Bundle/Ui/DataProvider/Product/Form/Modifier/BundlePanel.php
magento2/app/code/Magento/Catalog/Test/Unit/Block/Adminhtml/Product/Edit/Button/AddAttributeTest.php
magento2/app/code/Magento/Catalog/Ui/DataProvider/Product/Form/Modifier/Categories.php
magento2/app/code/Magento/ConfigurableProduct/Test/Unit/Ui/DataProvider/Product/Form/Modifier/ConfigurablePriceTest.php
magento2/app/code/Magento/Paypal/Test/Unit/Model/Payflow/Service/Response/Handler/FraudHandlerTest.php
magento2/app/code/Magento/Paypal/Test/Unit/Model/CartTest.php
magento2/app/code/Magento/Weee/Test/Unit/Model/Total/Quote/WeeeTaxTest.php
magento2/lib/internal/Magento/Framework/Code/Test/Unit/_files/app/code/Magento/SomeModule/Model/SevenInterface.php
magento2/lib/internal/Magento/Framework/Code/Test/Unit/Generator/InterfaceGeneratorTest.php```

@ihor-sviziev ihor-sviziev reopened this Jan 20, 2018
@ihor-sviziev ihor-sviziev changed the title [WIP] Fix code style issues with php-cs-fixer Fix code style issues with php-cs-fixer Jan 20, 2018
@ishakhsuvarov
Copy link
Contributor

@ihor-sviziev Looks like it is not possible to easily refactor Magento/Ui/Component/Listing/Columns/Column. Warning may be suppressed.

@orlangur
Copy link
Contributor

One more time :D It will be pretty strange if this PR will be merged "as is" as it does not differ from other attempts.

  • Does not make sense without codingStandardsIgnoreFile removal in 2.2-develop
  • Static test enforcing no php-cs-fixer violations shall be implemented as well

After branch is ready and green, please rewrite commits history in the way similar to #9367 - manual changes which do not make sense in separate commit should be squashed.

Good luck!

@ishakhsuvarov
Copy link
Contributor

@orlangur It is still a challenge, to process this kind of PR, same as all previous attempts :)

@ihor-sviziev
Copy link
Contributor Author

ihor-sviziev commented Jan 24, 2018

As we discussed with @ishakhsuvarov in slack - these changes couldn't be added to next 2.2 patch release because of huge list of changes, so I will prepare these changes to 2.3-develop branch

@orlangur
Copy link
Contributor

@ihor-sviziev there are no coding style issues in 2.3-develop branch actually after a contribution by @sidolov :)

And if we just apply php-cs-fixer all over the codebase, besides test which would enforce it I believe it would be good to revise set of rules in .php_cs (expand to teh max I mean).

@ihor-sviziev
Copy link
Contributor Author

Let's close this PR. I will prepare new PR once I'll have time for that to 2.3-develop branch

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.

3 participants