-
Notifications
You must be signed in to change notification settings - Fork 379
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
[CS] Implement new php-cs-fixer rules and related code cleanup #1040
Conversation
we should discuss the use of |
I see a lot commits adding the backslash for performance reasons: symfony/symfony#25854 |
My vote for |
php-cs-fixer is not currently installed in the 2.0 branch. i add it back in #1045 should we run the php-cs-fixer in travis-ci? if not, we won't see whether the configuration for styleci and php-cs-fixer conflict... |
PHP-CS-Fixer is now integrated in travis-ci here are the results https://travis-ci.org/liip/LiipImagineBundle/jobs/336491426 |
interesting. i think we miss a couple styleci rules, notably yoda. in the end, if php-cs-fixer is slightly stricter than styleci, i think its acceptable, but those things we can we should also put into styleci so that automatic fixing is available. or we drop styleci completely and have only fixing by the user in their cli as an option. |
@dbu This is a new set of styles (compared to our old rule set this one adds a number of additional fixers), so there are some drastic changes this will apply outside the current @sebastianblum You should add the yoda rule, assuming |
@robfrawley Yoda style is included in @symfony already. I created this pull request to create the php-cs-fixer configuration and if @robfrawley and @dbu agree, I will create a new pull request optimizing the code.
But we have to discuss how to merge new features from 1.0 to 2.0. Do we have a timeline for supporting 1.0? |
@sebastianblum About a week ago @lsmith77 and I spoke briefly about support for Your plan outline looks good to me. |
Good, I created #1049 for the future. Should we do the style fixing in this pull request or in a new one? |
the final call is up to you @sebastianblum and @robfrawley but the style rules seem all sensible to me. if you add the rules in version 1 too, its probably easier to merge 1.0 to 2.0 when you want to merge bugfixes upstream. |
I'll handle merging this, running the new styles, and updating styleci in one at the same time. I think your work is done! I'll get this done shortly. |
@dbu Good call about applying them to 1.0 to avoid merge conflicts. Will handle that too then. |
- created new rule set as discussed by community - removed broken php-cs-fixer-styleci-bridge usage
- add additional rules and sort all alphabetically - fix code broken by new rules - cleanup .php_cs.dist file and align with cs standards - add .php_cs.cache to .gitignore
While fixing the tests in #1035 I saw a lot of wrong namespaces. Trying to run php-cs-fixer returns an error, so I updated the php-cs-fixer configuration.
The main rules are coming directly vom symfony/demo, https://github.com/symfony/demo/blob/master/.php_cs.dist
The question is, what merge strategy from 1.x to 2.x will be chosen and which rules make sense.
After the have defined the rules, I will add the changes to the php files and try to fix the scrutiniser checks.