From e3f4e82f55631cdefbf89d8496b5b17ef5614ce3 Mon Sep 17 00:00:00 2001 From: rtcoder Date: Wed, 17 Jun 2026 19:18:19 +0200 Subject: [PATCH] Add CLI quality checks --- README.md | 9 ++ REFACTORING.md | 3 +- docs/index.html | 21 +++- src/Console/Commands/Doctor.php | 62 +--------- src/Console/Commands/Lint.php | 49 ++++++++ src/Console/Commands/Qa.php | 49 ++++++++ src/Console/Console.php | 4 +- src/Console/Quality/CheckResult.php | 36 ++++++ src/Console/Quality/ProjectFileFinder.php | 124 +++++++++++++++++++ src/Console/Quality/QualityChecks.php | 141 ++++++++++++++++++++++ src/Error/ErrorHandler.php | 8 +- src/Service/ServiceContainer.php | 2 +- src/Service/ServiceInterface.php | 2 +- tests/Feature/QualityCommandsTest.php | 62 ++++++++++ 14 files changed, 502 insertions(+), 70 deletions(-) create mode 100644 src/Console/Commands/Lint.php create mode 100644 src/Console/Commands/Qa.php create mode 100644 src/Console/Quality/CheckResult.php create mode 100644 src/Console/Quality/ProjectFileFinder.php create mode 100644 src/Console/Quality/QualityChecks.php create mode 100644 tests/Feature/QualityCommandsTest.php diff --git a/README.md b/README.md index 118a8ba..8b7f5e3 100644 --- a/README.md +++ b/README.md @@ -451,6 +451,15 @@ Run the test suite: ./shift test ``` +Run local quality checks: + +```sh +./shift lint +./shift qa +``` + +`shift lint` checks PHP syntax and basic file hygiene. `shift qa` runs Composer validation, lint checks, the test suite, and route listing. + Run the example module command: ```sh diff --git a/REFACTORING.md b/REFACTORING.md index 9a11a06..330dbda 100644 --- a/REFACTORING.md +++ b/REFACTORING.md @@ -40,6 +40,7 @@ ShiftPHP is moving toward an API-only modular monolith. View templates, compiled - [x] Structured exception logging with JSON file logger and service container override. - [x] Request id lifecycle with generated `X-Request-Id` response headers and log context. - [x] Developer documentation organized into a Laravel-like guide. +- [x] CLI quality gate with `shift lint` and `shift qa`. - [x] Removal of view storage and example page assets from runtime. - [x] Removal of legacy `application/controllers` and `application/routes.php`. - [x] Domain-oriented framework namespaces: @@ -165,4 +166,4 @@ Internal errors return a generic `500` message unless `display_errors` is enable ## Next -- [ ] Static analysis and coding style checks. +- [ ] Deeper static analysis for framework contracts and type safety. diff --git a/docs/index.html b/docs/index.html index 179d170..77435ce 100644 --- a/docs/index.html +++ b/docs/index.html @@ -297,6 +297,7 @@

Operations