Fixing indentation is broken in Laravel preset since 1.8.0
hjanos1 opened this issue · comments
Pint Version
1.9.0
PHP Version
8.2.0
Description
Fixing indentation is broken in the Laravel preset since #166 was merged.
This is caused by the statement_indentation rule not being enabled in the Laravel preset.
Before the above PR was merged, the rule was being run by the braces rule.
Resolution: statement_indentation rule should be enabled in the Laravel preset. Sending a PR.
Steps To Reproduce
- Edit a file so that the indentation is broken
- Run pint
- Formatting (indentation) should be fixed, but it is not.
Example on a new laravel project, edited app/Providers/AppServiceProvider.php
:
➜ pint-test git:(master) ✗ cat app/Providers/AppServiceProvider.php
<?php
namespace App\Providers;
use Illuminate\Support\ServiceProvider;
class AppServiceProvider extends ServiceProvider
{
/**
* Register any application services.
*/
public function register(): void
{
//
}
/**
* Bootstrap any application services.
*/
public function boot(): void
{
//
}
}
➜ pint-test git:(master) ✗ ./vendor/bin/pint --version
Pint 1.9.0
➜ pint-test git:(master) ✗ ./vendor/bin/pint app/Providers/AppServiceProvider.php
.
───────────────────────────────────────────────────────────────────────────────── Laravel
PASS ......................................................................... 1 file
Ping @Jubeki
Yeah that seems to fix it (see pint.json below).
I assumed there was a reason statement_indentation was already disabled beforehand and so I didn't touch it further.
{
"preset": "laravel",
"rules": {
"statement_indentation": true
}
}