Commit 65f180cbbc4 for woocommerce
commit 65f180cbbc482ee71c415b1704fcc404929a0ce4
Author: Brandon Kraft <public@brandonkraft.com>
Date: Mon Apr 20 07:40:33 2026 -0500
Add PHPStan baseline policy to AGENTS.md (#64192)
* Add PHPStan baseline policy to AGENTS.md
Clarify that the PHPStan baseline should never grow — new errors must
be fixed in code, and the baseline should only shrink as existing
errors are resolved naturally over time.
* docs: Add changelog entry for PHPStan baseline policy
diff --git a/AGENTS.md b/AGENTS.md
index 9e0badc297d..dbd94519134 100644
--- a/AGENTS.md
+++ b/AGENTS.md
@@ -95,7 +95,7 @@ pnpm --filter=@woocommerce/plugin-woocommerce lint:php:changes
composer exec -- phpstan analyse path/to/modified/File.php --memory-limit=2G
```
-PHPStan failures often indicate the need to update the baseline file (`phpstan-baseline.neon`). If your fix resolves a previously baselined error, remove the corresponding entry from the baseline.
+**PHPStan Baseline Policy:** The baseline file (`phpstan-baseline.neon`) must never be added to. It should only shrink over time as existing errors are naturally resolved by code changes. If PHPStan reports a new error, fix it in the code rather than adding it to the baseline. If your fix resolves a previously baselined error, remove the corresponding entry from the baseline.
### Pre-push Checks