laravel / pint

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

Add `--no-config` option #250

Closed jasonmccreary closed 8 months ago

jasonmccreary commented 8 months ago

Currently, pint will merge any project config with the --preset option. This was slightly unexpected and makes it difficult to quickly use one of the presents from within a project that has a custom pint.json config.

You can get around this by passing an invalid path to --config. But that's a bit hacky. I felt a --no-config option was nice and provides an explicit way to prevent pint from merging any project config.

For example, to apply the laravel preset to a set of stub files:

pint --no-config --preset laravel -- stubs

This is indeed a real world use case where a project has it's own rules configured within pint.json, but contains stub files which are formatted to the laravel preset.