Skip to content
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

Introduce the none preset #225

Closed
wants to merge 1 commit into from
Closed

Conversation

lucasmichot
Copy link
Contributor

@lucasmichot lucasmichot commented Oct 10, 2023

In case there is no config file or preset provided, pint will use laravel per default.
It comes handy, but this preset will ALWAYS be applied if we only want to apply specific rules to fix the code.

This PR introduces a none preset, which comes as an empty ruleset, thus providing way more flexibility to the developers to apply cherry-picked rules.


Note:
This preset could be named differently, I am not really opinionated on that.

@taylorotwell
Copy link
Member

The goal of Pint was to be a very opinionated zero-config formatter. I feel like we are drifting away from that a bit.

@Konafets
Copy link

Konafets commented Nov 2, 2023

In a legacy code base I want to apply the rules one by one instead having a giant PR with all kind of changes mixed up. Pint should either support a parameter to use a single rule or a none ruleset like this PR, where I can add rules incrementally.

Without this and in a legacy project Pint is far away from zero-config.

@driftingly
Copy link

@Konafets you could use PHP-CS-Fixer and introduce rules bit by bit to build up to the Laravel preset, then switch over to use Pint.

@lucasmichot
Copy link
Contributor Author

lucasmichot commented Nov 3, 2023

Hey @Konafets, I am also using PHP-CS-Fixer only for this very specific use-case.
Within my .php-cs-fixer.php file, I am loading my custom rules from my pint.json file.
This works and is pretty hacky, but TBH, this is also extremely inconvenient

Wish to re-consider @nunomaduro ?

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.

5 participants