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

Exclude Specific Rule of Laravel Pint in a Folder or File #281

Closed WeedTest closed 2 months ago

WeedTest commented 2 months ago

Description: I would like to request the ability to exclude a specific rule of Laravel Pint in a specified folder or file. This feature would allow other rules to be applied to the path, while the excluded rule is specified in the configuration.

Use Case:

Proposed Solution:

Steps to Reproduce:

  1. Configure Laravel Pint with a set of rules in pint.json.
  2. Specify a folder or file where one of the rules should be excluded.
  3. Run Laravel Pint and observe that all rules except the excluded one are applied to the specified path.

Example Configuration:

{
    "preset": "laravel",
    "exclude": {
        "rules": [
            "some-specific-rule"
        ],
        "paths": [
            "path/to/excluded-folder",
            "path/to/excluded-file.php"
        ]
    }
}

Benefits:

driesvints commented 2 months ago

Thanks. Right now we're not planning on this sorry but you can always attempt a PR if you want to.