pint
pint copied to clipboard
feat: add support for user-defined presets via composer
Hello!
This allows users to create and distribute custom presets through composer packages, enabling better code style sharing across projects. I also updated pint to use the new preset manifest system so there's a unified method of registering presets.
Presets are added in the composer extra section like so:
"extra": {
"laravel-pint": {
"presets": {
"laravel": "resources/presets/laravel.php",
"per": "resources/presets/per.php",
"psr12": "resources/presets/psr12.php",
"symfony": "resources/presets/symfony.php",
"empty": "resources/presets/empty.php"
}
}
},
[!NOTE] I'm aware that it's possible to pass a custom config file like
./vendor/bin/pint --config vendor/my-company/coding-style/pint.json, however, it's much nicer to be able to simple define a custom company preset which then is referenced in all pint configs
This also adds a new preset:list command to show all available presets:
Thanks!