diff --git a/.harness.json b/.harness.json index 8a2893a5..30298095 100644 --- a/.harness.json +++ b/.harness.json @@ -3,6 +3,7 @@ "mode": "enforce", "ratchet": { "phpstan_level": 5, - "phpstan_baseline": 58 + "phpstan_baseline": 58, + "coverage": 53 } } diff --git a/CLAUDE.md b/CLAUDE.md index 40026a2a..8d9db881 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -14,7 +14,7 @@ Pollora is a Laravel & WordPress integration framework that creates a "sweet ble ddev exec --dir /var/www/html/vendor/pollora/framework composer test # Individual test commands -ddev exec --dir /var/www/html/vendor/pollora/framework composer test:unit # Run PHPUnit tests with coverage (requires 100% coverage) +ddev exec --dir /var/www/html/vendor/pollora/framework composer test:unit # Run the Pest tests ddev exec --dir /var/www/html/vendor/pollora/framework composer test:types # Run PHPStan static analysis ddev exec --dir /var/www/html/vendor/pollora/framework composer test:lint # Test code formatting with Pint ddev exec --dir /var/www/html/vendor/pollora/framework composer test:refacto # Test refactoring rules with Rector (dry-run) @@ -25,7 +25,8 @@ ddev exec --dir /var/www/html/vendor/pollora/framework composer refacto ``` ### Key Quality Standards -- **Test Coverage**: 100% test coverage is required (`--min=100`) +- **Type Coverage**: at least 98% (`composer test:type-coverage`, enforced by the CI) +- **Line Coverage**: tracked, not a fixed target. The Harness ratchet (`coverage` in `.harness.json`) fails a change that lowers it, so a pull request that adds code adds the tests that keep the figure up - **Static Analysis**: PHPStan level 5 with WordPress and Laravel extensions - **Code Style**: Laravel Pint for PHP formatting, Prettier for JS/MD/YAML - **Refactoring**: Rector with Laravel-specific rules diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index c00ef609..6e09579e 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -36,8 +36,8 @@ outlines our guidelines and conventions. composer test ``` This executes Rector, Pint, PHPStan and the unit tests. -- Pull requests must pass the CI pipeline. Aim for 100% coverage as enforced by - the test configuration. +- Pull requests must pass the CI pipeline. A pull request must not lower + the line coverage recorded in `.harness.json`, and the type coverage stays at 98% or more. ## Commit Messages diff --git a/README.md b/README.md index 61db7ba5..75c920cd 100644 --- a/README.md +++ b/README.md @@ -82,7 +82,7 @@ Learn more: ```bash composer test # Run all checks (Rector, Pint, PHPStan, Pest, type coverage) -composer test:unit # Run Pest tests with 100% coverage requirement +composer test:unit # Run the Pest tests composer test:types # Run PHPStan static analysis composer test:lint # Check code style with Pint composer test:refacto # Check refactoring rules with Rector