Skip to content

Commit 8eaf73a

Browse files
authored
Improve Pint guidelines to support for Pint Agent Formatter (#425)
Signed-off-by: Pushpak Chhajed <pushpak1300@gmail.com>
1 parent 237e579 commit 8eaf73a

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

.ai/pint/core.blade.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,10 @@
33
@endphp
44
## Laravel Pint Code Formatter
55

6+
@if($assist->supportsPintAgentFormatter())
7+
- You must run `{{ $assist->binCommand('pint') }} --dirty --format agent` before finalizing changes to ensure your code matches the project's expected style.
8+
- Do not run `{{ $assist->binCommand('pint') }} --test --format agent`, simply run `{{ $assist->binCommand('pint') }} --format agent` to fix any formatting issues.
9+
@else
610
- You must run `{{ $assist->binCommand('pint') }} --dirty` before finalizing changes to ensure your code matches the project's expected style.
711
- Do not run `{{ $assist->binCommand('pint') }} --test`, simply run `{{ $assist->binCommand('pint') }}` to fix any formatting issues.
12+
@endif

src/Install/GuidelineAssist.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
use Illuminate\Database\Eloquent\Model;
88
use Laravel\Boost\Install\Assists\Inertia;
99
use Laravel\Roster\Enums\NodePackageManager;
10+
use Laravel\Roster\Enums\Packages;
1011
use Laravel\Roster\Roster;
1112
use ReflectionClass;
1213
use Symfony\Component\Finder\Finder;
@@ -164,6 +165,11 @@ public function inertia(): Inertia
164165
return new Inertia($this->roster);
165166
}
166167

168+
public function supportsPintAgentFormatter(): bool
169+
{
170+
return $this->roster->usesVersion(Packages::PINT, '1.27.0', '>=');
171+
}
172+
167173
public function nodePackageManager(): string
168174
{
169175
return ($this->roster->nodePackageManager() ?? NodePackageManager::NPM)->value;

0 commit comments

Comments
 (0)