-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
GroupImportFixer - introduction #4005
GroupImportFixer - introduction #4005
Conversation
57e846a
to
fb2dbf7
Compare
a1f0de6
to
a10cee5
Compare
Can you add a test case with these imports:
? Possibly other combinations. Also I wonder what strategy should be also in such case:
Should it group by |
|
@keradus @SpacePossum @kubawerlos guys, can you check this PR, please? Is it OK? |
I think this new rule must be added to the (known) conflicts map here |
When testing:
It seems the rule created: <?php
namespace PhpCsFixer\Tokenizer\Transformer;
use PhpCsFixer\Tokeniz\{use PhpCsFixer\Tokenizer\{CT, Token, Tokens}; form: namespace PhpCsFixer\Tokenizer\Transformer;
use PhpCsFixer\Tokenizer\AbstractTransformer;
use PhpCsFixer\Tokenizer\CT;
use PhpCsFixer\Tokenizer\Token;
use PhpCsFixer\Tokenizer\Tokens; |
@SpacePossum Issue was fixed. It was related to Also I added test case for this. |
Wasn't it merged to Master? |
@basheerOct not yet. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add an integration (priority?) test that proves this new fixer plays nicely with ordered_imports
.
Friendly ping @greeflas. Would you have time to continue working on this PR? |
@juliendufresne yeap, I will check your comments when will have a time. |
@greeflas Hey, I would like to have this fixer. Will you update your merge request? |
3d71672
to
01435f0
Compare
@Okspen Yeap, waiting for @julienfalque response. |
@julienfalque & @SpacePossum Could you please review? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One last small issue and we're good 👍
5fc816e
to
a2d4912
Compare
@SpacePossum, @julienfalque Can you please merge the request or leave comments what is else required to finish it? Thanks! |
This is probably out of scope for this PR at this point, but I would love to be able to configure which types of imports this fixer applies to. e.g. I would group function and constant imports, but not classes or traits. Just something to keep in mind. |
5324864
to
648fcf9
Compare
Thanks @greeflas ! It has been almost 2 years and I'm sorry for the long wait. I'm very happy to have merge your PR and hope a lot of user will use it to their benefit! |
@SpacePossum Hooray! I hope for it as well! |
Hi guys! I just implemented feature #3143. Please check it and give me some feedback. Thanks in advance.