Skip to content

feat: add support for user-defined presets via composer #389

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

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

calebdw
Copy link

@calebdw calebdw commented Aug 8, 2025

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:

image

Thanks!

@calebdw calebdw force-pushed the calebdw/push-qxzutyruwpym branch 3 times, most recently from 54d27b0 to 291a5c2 Compare August 8, 2025 05:49
This allows users to create and distribute custom presets through
composer packages, enabling better code style sharing across projects.

This also adds a new `preset:list` command to show all available presets.
@calebdw calebdw force-pushed the calebdw/push-qxzutyruwpym branch from 291a5c2 to 02cf9d7 Compare August 8, 2025 05:52
@taylorotwell taylorotwell requested a review from nunomaduro August 8, 2025 14:02
@taylorotwell taylorotwell marked this pull request as draft August 8, 2025 14:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant