chore: move php-cs-fixer config into tools
- relocate .php-cs-fixer.dist.php to tools/php-cs-fixer/.php-cs-fixer.dist.php - update composer scripts, docs, quality gates, and style skill references - keep finder scope stable via project-root resolution - fix pre-existing unused imports reported by php-cs-fixer
This commit is contained in:
@@ -36,7 +36,7 @@
|
|||||||
"id": "QG-006",
|
"id": "QG-006",
|
||||||
"type": "fast",
|
"type": "fast",
|
||||||
"name": "PHP Style Check",
|
"name": "PHP Style Check",
|
||||||
"command": "docker compose exec php vendor/bin/php-cs-fixer fix --config=.php-cs-fixer.dist.php --dry-run --diff --verbose"
|
"command": "docker compose exec php vendor/bin/php-cs-fixer fix --config=tools/php-cs-fixer/.php-cs-fixer.dist.php --dry-run --diff --verbose"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "QG-007",
|
"id": "QG-007",
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ Coding-Style pruefbar, reproduzierbar und regressionsarm machen.
|
|||||||
|
|
||||||
## Verbindliche Regeln
|
## Verbindliche Regeln
|
||||||
|
|
||||||
1. MUST `vendor/bin/php-cs-fixer fix --config=.php-cs-fixer.dist.php --dry-run --diff --verbose` fuer nicht-mutierende Pruefung nutzen (Convenience-Alias: `composer cs:check`).
|
1. MUST `vendor/bin/php-cs-fixer fix --config=tools/php-cs-fixer/.php-cs-fixer.dist.php --dry-run --diff --verbose` fuer nicht-mutierende Pruefung nutzen (Convenience-Alias: `composer cs:check`).
|
||||||
2. MUST `composer cs:fix` nur bewusst und mit Diff-Kontrolle ausfuehren.
|
2. MUST `composer cs:fix` nur bewusst und mit Diff-Kontrolle ausfuehren.
|
||||||
3. MUST Style-Check vor Merge gruen halten (lokal und optional CI).
|
3. MUST Style-Check vor Merge gruen halten (lokal und optional CI).
|
||||||
4. MUST nach groesseren Fixes mindestens `phpunit` und `phpstan` laufen lassen.
|
4. MUST nach groesseren Fixes mindestens `phpunit` und `phpstan` laufen lassen.
|
||||||
@@ -25,7 +25,7 @@ Coding-Style pruefbar, reproduzierbar und regressionsarm machen.
|
|||||||
|
|
||||||
## Workflow
|
## Workflow
|
||||||
|
|
||||||
1. Baseline erfassen: `vendor/bin/php-cs-fixer fix --config=.php-cs-fixer.dist.php --dry-run --diff --verbose`.
|
1. Baseline erfassen: `vendor/bin/php-cs-fixer fix --config=tools/php-cs-fixer/.php-cs-fixer.dist.php --dry-run --diff --verbose`.
|
||||||
2. Falls noetig fixen: `composer cs:fix`.
|
2. Falls noetig fixen: `composer cs:fix`.
|
||||||
3. Diff fokussiert pruefen (Imports, Braces, Nebenwirkungen).
|
3. Diff fokussiert pruefen (Imports, Braces, Nebenwirkungen).
|
||||||
4. Qualitaetsgates laufen lassen.
|
4. Qualitaetsgates laufen lassen.
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ CI soll nur pruefen, nicht formatieren.
|
|||||||
## Minimaler Check
|
## Minimaler Check
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
vendor/bin/php-cs-fixer fix --config=.php-cs-fixer.dist.php --dry-run --diff --verbose
|
vendor/bin/php-cs-fixer fix --config=tools/php-cs-fixer/.php-cs-fixer.dist.php --dry-run --diff --verbose
|
||||||
```
|
```
|
||||||
|
|
||||||
## Erwartung
|
## Erwartung
|
||||||
|
|||||||
@@ -3,13 +3,13 @@
|
|||||||
## Commands
|
## Commands
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
vendor/bin/php-cs-fixer fix --config=.php-cs-fixer.dist.php --dry-run --diff --verbose
|
vendor/bin/php-cs-fixer fix --config=tools/php-cs-fixer/.php-cs-fixer.dist.php --dry-run --diff --verbose
|
||||||
composer cs:fix
|
composer cs:fix
|
||||||
```
|
```
|
||||||
|
|
||||||
## Praktikabler Ablauf
|
## Praktikabler Ablauf
|
||||||
|
|
||||||
1. Erst Style-Check laufen lassen (`vendor/bin/php-cs-fixer fix --config=.php-cs-fixer.dist.php --dry-run --diff --verbose`).
|
1. Erst Style-Check laufen lassen (`vendor/bin/php-cs-fixer fix --config=tools/php-cs-fixer/.php-cs-fixer.dist.php --dry-run --diff --verbose`).
|
||||||
2. Danach `cs:fix`.
|
2. Danach `cs:fix`.
|
||||||
3. Nur relevante Diffs uebernehmen, grosse Misch-Diffs vermeiden.
|
3. Nur relevante Diffs uebernehmen, grosse Misch-Diffs vermeiden.
|
||||||
4. Anschliessend:
|
4. Anschliessend:
|
||||||
|
|||||||
@@ -209,7 +209,7 @@ These rules are enforced by guards GR-SEC-001 through GR-SEC-009 in `.agents/che
|
|||||||
| QG-001 | PHPUnit | `vendor/bin/phpunit` |
|
| QG-001 | PHPUnit | `vendor/bin/phpunit` |
|
||||||
| QG-002 | PHPStan level 5 | `vendor/bin/phpstan analyse -c phpstan.neon` |
|
| QG-002 | PHPStan level 5 | `vendor/bin/phpstan analyse -c phpstan.neon` |
|
||||||
| QG-003 | Architecture Contract | `vendor/bin/phpunit tests/Architecture/CoreStarterkitContractTest.php` |
|
| QG-003 | Architecture Contract | `vendor/bin/phpunit tests/Architecture/CoreStarterkitContractTest.php` |
|
||||||
| QG-006 | PHP Style | `vendor/bin/php-cs-fixer fix --config=.php-cs-fixer.dist.php --dry-run --diff --verbose` |
|
| QG-006 | PHP Style | `vendor/bin/php-cs-fixer fix --config=tools/php-cs-fixer/.php-cs-fixer.dist.php --dry-run --diff --verbose` |
|
||||||
|
|
||||||
Additional gates (fast/periodic): QG-004 structural checks, QG-005 JS smoke, QG-007 composer-unused, QG-008 docs links, QG-009 skills sync. See gate catalog for details.
|
Additional gates (fast/periodic): QG-004 structural checks, QG-005 JS smoke, QG-007 composer-unused, QG-008 docs links, QG-009 skills sync. See gate catalog for details.
|
||||||
|
|
||||||
|
|||||||
@@ -220,7 +220,7 @@ docker compose exec php vendor/bin/phpstan analyse -c phpstan.neon --no-progress
|
|||||||
CI-Check (ohne Dateien zu aendern):
|
CI-Check (ohne Dateien zu aendern):
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
docker compose exec php vendor/bin/php-cs-fixer fix --config=.php-cs-fixer.dist.php --dry-run --diff --verbose
|
docker compose exec php vendor/bin/php-cs-fixer fix --config=tools/php-cs-fixer/.php-cs-fixer.dist.php --dry-run --diff --verbose
|
||||||
```
|
```
|
||||||
|
|
||||||
Lokal automatisch formatieren:
|
Lokal automatisch formatieren:
|
||||||
|
|||||||
@@ -38,7 +38,7 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"cs:check": "php-cs-fixer fix --config=.php-cs-fixer.dist.php --dry-run --diff --verbose",
|
"cs:check": "php-cs-fixer fix --config=tools/php-cs-fixer/.php-cs-fixer.dist.php --dry-run --diff --verbose",
|
||||||
"cs:fix": "php-cs-fixer fix --config=.php-cs-fixer.dist.php --verbose"
|
"cs:fix": "php-cs-fixer fix --config=tools/php-cs-fixer/.php-cs-fixer.dist.php --verbose"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -345,7 +345,7 @@ Nicht-deklarierte Cross-Module-Imports sind verboten und werden per Architektur-
|
|||||||
- [ ] PHPUnit gruent (`vendor/bin/phpunit`)
|
- [ ] PHPUnit gruent (`vendor/bin/phpunit`)
|
||||||
- [ ] PHPStan Level 5 gruent (`vendor/bin/phpstan analyse -c phpstan.neon`)
|
- [ ] PHPStan Level 5 gruent (`vendor/bin/phpstan analyse -c phpstan.neon`)
|
||||||
- [ ] Architektur-Tests gruent (`tests/Architecture/`)
|
- [ ] Architektur-Tests gruent (`tests/Architecture/`)
|
||||||
- [ ] PHP-CS-Fixer gruent (`vendor/bin/php-cs-fixer fix --dry-run`)
|
- [ ] PHP-CS-Fixer gruent (`vendor/bin/php-cs-fixer fix --config=tools/php-cs-fixer/.php-cs-fixer.dist.php --dry-run`)
|
||||||
- [ ] AuthorizationPolicy ist im Container registriert (falls Konstruktor-Parameter vorhanden)
|
- [ ] AuthorizationPolicy ist im Container registriert (falls Konstruktor-Parameter vorhanden)
|
||||||
- [ ] Alle sichtbaren Texte nutzen `t('...')`
|
- [ ] Alle sichtbaren Texte nutzen `t('...')`
|
||||||
- [ ] Session-Keys verwenden `module.<id>.*` Prefix
|
- [ ] Session-Keys verwenden `module.<id>.*` Prefix
|
||||||
|
|||||||
@@ -20,9 +20,6 @@ use MintyPHP\Service\Access\AssignableRoleService;
|
|||||||
use MintyPHP\Service\Access\PermissionService;
|
use MintyPHP\Service\Access\PermissionService;
|
||||||
use MintyPHP\Service\Audit\AuditRecorderInterface;
|
use MintyPHP\Service\Audit\AuditRecorderInterface;
|
||||||
use MintyPHP\Service\Audit\ImportAuditInterface;
|
use MintyPHP\Service\Audit\ImportAuditInterface;
|
||||||
use MintyPHP\Service\Audit\NullAuditRecorder;
|
|
||||||
use MintyPHP\Service\Audit\NullImportAudit;
|
|
||||||
use MintyPHP\Service\Audit\NullUserLifecycleAudit;
|
|
||||||
use MintyPHP\Service\Audit\UserLifecycleAuditInterface;
|
use MintyPHP\Service\Audit\UserLifecycleAuditInterface;
|
||||||
use MintyPHP\Service\Auth\AuthGatewayFactory;
|
use MintyPHP\Service\Auth\AuthGatewayFactory;
|
||||||
use MintyPHP\Service\Auth\AuthRepositoryFactory;
|
use MintyPHP\Service\Auth\AuthRepositoryFactory;
|
||||||
@@ -32,7 +29,6 @@ use MintyPHP\Service\CustomField\CustomFieldServicesFactory;
|
|||||||
use MintyPHP\Service\Directory\DirectoryGatewayFactory;
|
use MintyPHP\Service\Directory\DirectoryGatewayFactory;
|
||||||
use MintyPHP\Service\Directory\DirectoryRepositoryFactory;
|
use MintyPHP\Service\Directory\DirectoryRepositoryFactory;
|
||||||
use MintyPHP\Service\Directory\DirectoryServicesFactory;
|
use MintyPHP\Service\Directory\DirectoryServicesFactory;
|
||||||
use MintyPHP\Service\Import\ImportRepositoryFactory;
|
|
||||||
use MintyPHP\Service\Import\ImportServicesFactory;
|
use MintyPHP\Service\Import\ImportServicesFactory;
|
||||||
use MintyPHP\Service\Mail\MailRepositoryFactory;
|
use MintyPHP\Service\Mail\MailRepositoryFactory;
|
||||||
use MintyPHP\Service\Mail\MailServicesFactory;
|
use MintyPHP\Service\Mail\MailServicesFactory;
|
||||||
|
|||||||
@@ -1,11 +1,13 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
$projectRoot = dirname(__DIR__, 2);
|
||||||
|
|
||||||
$finder = PhpCsFixer\Finder::create()
|
$finder = PhpCsFixer\Finder::create()
|
||||||
->in([
|
->in([
|
||||||
__DIR__ . '/config',
|
$projectRoot . '/config',
|
||||||
__DIR__ . '/lib',
|
$projectRoot . '/lib',
|
||||||
__DIR__ . '/pages',
|
$projectRoot . '/pages',
|
||||||
__DIR__ . '/tests',
|
$projectRoot . '/tests',
|
||||||
])
|
])
|
||||||
->name('*.php');
|
->name('*.php');
|
||||||
|
|
||||||
Reference in New Issue
Block a user