From e90ce311b3050c4e1f13a8dcf1fea0afde2ef57c Mon Sep 17 00:00:00 2001 From: DariusIII Date: Tue, 28 Apr 2026 11:03:52 +0200 Subject: [PATCH] Update agents.md --- AGENTS.md | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/AGENTS.md b/AGENTS.md index 3d5002630..87cdedb21 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -94,15 +94,26 @@ PHPUnit only (no Pest). Create tests: `php artisan make:test --phpunit {name}` - The ordinal field is intentionally hidden on `resources/views/admin/content/add.blade.php`; the server assigns new items to the bottom of their own group in `AdminContentController::nextBottomOrdinal()` - Deleting content does not renumber remaining items; gaps in per-group ordinals are expected -## Code Formatting +## Code Formatting & Quality -**Always run Pint after completing any PHP code changes:** +**After every code change, run all of the following before considering a task done:** +### 1. Format changed PHP files ```bash ./vendor/bin/pint --dirty # Format only changed files ``` -This is mandatory — run it before considering any task done. Do not wait for the pre-commit hook to catch formatting issues. +### 2. Check for static analysis errors +```bash +./vendor/bin/phpstan analyse --memory-limit=2G # Run PHPStan static analysis +``` + +### 3. Check for syntax / lint errors +```bash +find app -name "*.php" | xargs php -l # PHP syntax lint on all changed files +``` + +> **These steps are mandatory.** Run them before considering any task done. Do not wait for the pre-commit hook to catch formatting or type errors. If PHPStan reports new errors introduced by your changes, fix them before finishing. If you add a PHPStan baseline entry, document why. ## Pre-commit (CaptainHook)