laravel / pint

Laravel Pint is an opinionated PHP code style fixer for minimalists.
https://laravel.com/docs/pint
MIT License
2.75k stars 138 forks source link

Unable to sort group imports by length #273

Closed yaddly closed 3 months ago

yaddly commented 3 months ago

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

The default sorting algorithm for group_importis 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'].

Jubeki commented 3 months ago

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.

driesvints commented 3 months ago

Thanks @Jubeki.