Closed matt-usurp closed 7 years ago
@matt-usurp Great!
Could you please add some tests failing in a branch¿? After that we can add the fixes :)
Thanks!
@mmoreram Yeah sure, I don't know how you want to do this but I have a branch on my fork.
https://github.com/matt-usurp/php-formatter/tree/issue-24-grouping-whitespace
I added two failing tests that look like they will cover it. One for when removal of empty groups is enabled and one without, so looks like maybe skip empty groups isn't the issue.
Not to worry, I have applied the fix and updated the PR.
@mmoreram Can you take a look please, it would be great to get this fixed.
I have been noticing this issue often and have been meaning to attempt to fix it. I haven't had time and I keep forgetting so I am creating this issue as a kind of reminder. Also hoping that someone will know exactly why this is happening and be able to submit a fix faster than me.
It looks like when sorting use-statements in fairly complex groups and two groups consecutively are not being used there are some additional spaces added.
Example pulled from my test classes.
With the following configuration:
Please note that
group-skip-empty
is enabled also.Expecting output: