From bcca2331a84c038d55480649af3f4737eca91425 Mon Sep 17 00:00:00 2001 From: Liam Hammett Date: Sat, 16 Aug 2025 23:18:54 +0200 Subject: [PATCH] Put user-defined project guidelines at the top of the generated guidelines file --- src/Install/GuidelineComposer.php | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/Install/GuidelineComposer.php b/src/Install/GuidelineComposer.php index 6e073138..af683598 100644 --- a/src/Install/GuidelineComposer.php +++ b/src/Install/GuidelineComposer.php @@ -84,6 +84,14 @@ public function guidelines(): Collection protected function find(): Collection { $guidelines = collect(); + + $userGuidelines = $this->guidelineFilesInDir(base_path($this->userGuidelineDir)); + + foreach ($userGuidelines as $guideline) { + $guidelineKey = '.ai/'.$guideline->getBasename('.blade.php'); + $guidelines->put($guidelineKey, $this->guideline($guideline->getPathname())); + } + $guidelines->put('foundation', $this->guideline('foundation')); $guidelines->put('boost', $this->guideline('boost/core')); @@ -130,13 +138,6 @@ protected function find(): Collection $guidelines->put('tests', $this->guideline('enforce-tests')); } - $userGuidelines = $this->guidelineFilesInDir(base_path($this->userGuidelineDir)); - - foreach ($userGuidelines as $guideline) { - $guidelineKey = '.ai/'.$guideline->getBasename('.blade.php'); - $guidelines->put($guidelineKey, $this->guideline($guideline->getPathname())); - } - return $guidelines ->whereNotNull() ->where(fn ($guideline) => ! empty(trim($guideline)));