mmoreram / php-formatter

PHP Formatter is a PHP developer friendly set of tools
MIT License
166 stars 17 forks source link

Add subgroups to allow sorting within a group #13

Closed hacfi closed 9 years ago

hacfi commented 9 years ago

Example .formatter.yml:

use-sort:
    group:
        - [Symfony\Component\HttpKernel, Symfony]
        - _main
        - App

to put Symfony\Component\HttpKernel classes on top of the group

Fixes #10

hacfi commented 9 years ago

ping @mmoreram

mmoreram commented 9 years ago

@hacfi I've been so busy :( After the Con I will review both PRs and I'll merge them. Thanks for your effort :)

mmoreram commented 9 years ago

ping @hacfi I need this feature to be tested properly, and to be ensured that:

Thanks

hacfi commented 9 years ago

@mmoreram Sorry..overlooked that there are already tests. Will work on them next week.

hacfi commented 9 years ago

Had a little rebase conflict because of my other PR but all fixed now.

Included a small test for both this PR and #12. Wasn’t sure how to test for no bc breaks but all previous tests passed!?

hacfi commented 9 years ago

@mmoreram anything missing?

xphere commented 9 years ago

ping @mmoreram :grin:

hacfi commented 9 years ago

RTM @mmoreram :grinning:

mmoreram commented 9 years ago

@hacfi Could you please document this feature? Ready to be merged...

hacfi commented 9 years ago

@mmoreram Sure. Just noticed that this feature can’t be used without the config or is there a way to pass an array as a cli argument?

hacfi commented 9 years ago

Fixed some typos while I was at it

xphere commented 9 years ago

Just found I can't join _main with another namespaces inside same group, like:

use-sort:
    group:
        - [ Symfony, _main ]
        - Elcodi
hacfi commented 9 years ago

@xphere Will have a look on the weekend..I only had sub-namespaces in mind so didn’t check that.

mmoreram commented 9 years ago

Hmmm ok :) Please, fix asap as possible :')

hacfi commented 9 years ago

I don’t really understand the use-case but will try to fix it asap.

mmoreram commented 9 years ago

well, let's find out what the problem is, let's add some tests in order to make them fail, and then, let's fix it :dancer:

ASk me some help if you need it ! :)