laravel/pint

Unable to sort group imports by length

yaddly opened this issue · 2 comments

Hi pint team, may you please consider adding sorting options to the group_import rule.

The default sorting algorithm for group_import is alpha for alphabetically sorting but there are no other options. I would be more flexible to give users control over how to sort group_import with options such as ['alpha', 'length', 'unsorted'].

All available options for the group_import rule are part of PHP-CS-Fixer and can be found on their website: https://cs.symfony.com/doc/rules/import/group_import.html

If you want a configuration like ['alpha', 'length', 'unsorted'] to be added, I recommend heading over to https://github.com/PHP-CS-Fixer/PHP-CS-Fixer and to create a Pull Request with your desired changes.