|
25 | 25 | "phpmetrics:violations": "./vendor/bin/phpmetrics --violations-xml=phpmetrics/violations.xml phpcs-custom-sniffs", |
26 | 26 | "psalm": "./vendor/bin/psalm --threads=1 --no-cache", |
27 | 27 | "phpstan": "./vendor/bin/phpstan analyse --memory-limit=1G", |
28 | | - "test:unit": "if [ -f phpunit.xml ] || [ -f phpunit.xml.dist ]; then ./vendor/bin/phpunit --colors=always; else echo 'SKIPPED: no phpunit.xml in this repo - there is no PHP test suite to run'; fi", |
29 | | - "test:all": "if [ -f phpunit.xml ] || [ -f phpunit.xml.dist ]; then ./vendor/bin/phpunit --colors=always; else echo 'SKIPPED: no phpunit.xml in this repo - there is no PHP test suite to run'; fi", |
30 | | - "check": "E=0; for CMD in lint phpcs psalm test:unit; do echo; echo \"=== $CMD ===\"; composer $CMD || E=1; done; echo; if [ $E -eq 0 ]; then echo \"ALL CHECKS PASSED\"; else echo \"SOME CHECKS FAILED (see above)\"; fi; exit $E", |
31 | | - "check:full": "E=0; for CMD in lint phpcs psalm phpstan test:all; do echo; echo \"=== $CMD ===\"; composer $CMD || E=1; done; echo; if [ $E -eq 0 ]; then echo \"ALL CHECKS PASSED\"; else echo \"SOME CHECKS FAILED (see above)\"; fi; exit $E", |
32 | | - "check:strict": "E=0; for CMD in lint phpcs phpmd psalm phpstan test:all; do echo; echo \"=== $CMD ===\"; composer $CMD || E=1; done; echo; if [ $E -eq 0 ]; then echo \"ALL CHECKS PASSED\"; else echo \"SOME CHECKS FAILED (see above)\"; fi; exit $E", |
| 28 | + "check": "E=0; for CMD in lint phpcs psalm; do echo; echo \"=== $CMD ===\"; composer $CMD || E=1; done; echo; if [ $E -eq 0 ]; then echo \"ALL CHECKS PASSED - STATIC ANALYSIS ONLY, THIS REPO HAS NO TESTS.\"; else echo \"SOME CHECKS FAILED (see above)\"; fi; exit $E", |
| 29 | + "check:full": "E=0; for CMD in lint phpcs psalm phpstan; do echo; echo \"=== $CMD ===\"; composer $CMD || E=1; done; echo; if [ $E -eq 0 ]; then echo \"ALL CHECKS PASSED - STATIC ANALYSIS ONLY, THIS REPO HAS NO TESTS.\"; else echo \"SOME CHECKS FAILED (see above)\"; fi; exit $E", |
| 30 | + "check:strict": "E=0; for CMD in lint phpcs phpmd psalm phpstan; do echo; echo \"=== $CMD ===\"; composer $CMD || E=1; done; echo; if [ $E -eq 0 ]; then echo \"ALL CHECKS PASSED - STATIC ANALYSIS ONLY.\"; echo \"This is a Python ExApp: the application lives in ex_app/lib/, and the only\"; echo \"PHP in the repo is phpcs-custom-sniffs/. There is NO automated test suite of\"; echo \"any kind - no phpunit.xml, no tests/, no pytest config, no test_*.py - and\"; echo \"the Makefile 'test' target is an interactive 'docker run -it' that asserts\"; echo \"nothing and cannot run in CI. This green therefore says NOTHING about\"; echo \"behaviour. Do not re-add a test:all script until a real suite exists.\"; else echo \"SOME CHECKS FAILED (see above)\"; fi; exit $E", |
33 | 31 | "fix": [ |
34 | 32 | "@cs:fix" |
35 | 33 | ], |
36 | | - "test:coverage": "./vendor/bin/phpunit --coverage-html=coverage/html --coverage-clover=coverage/clover.xml --colors=always", |
37 | | - "coverage:check": "php -r \"\\$xml = simplexml_load_file('coverage/clover.xml'); \\$metrics = \\$xml->project->metrics; \\$statements = (int)\\$metrics['statements']; \\$covered = (int)\\$metrics['coveredstatements']; \\$percentage = \\$statements > 0 ? round((\\$covered / \\$statements) * 100, 2) : 0; echo 'Coverage: ' . \\$percentage . '%' . PHP_EOL; exit(\\$percentage < 75 ? 1 : 0);\"", |
38 | 34 | "quality:phpcs-score": "./vendor/bin/phpcs --standard=phpcs.xml --report=json phpcs-custom-sniffs | php -r \"\\$json = json_decode(file_get_contents('php://stdin'), true); \\$errors = \\$json['totals']['errors'] ?? 0; \\$warnings = \\$json['totals']['warnings'] ?? 0; \\$score = 1000 - \\$errors - (\\$warnings / 2); echo 'PHPCS Score: ' . \\$score . ' (Errors: ' . \\$errors . ', Warnings: ' . \\$warnings . ')' . PHP_EOL;\"", |
39 | 35 | "quality:phpmd-score": "./vendor/bin/phpmd phpcs-custom-sniffs json phpmd.xml | php -r \"\\$input = file_get_contents('php://stdin'); \\$json = json_decode(\\$input, true); \\$violations = count(\\$json['files'] ?? []); \\$score = 1000 - (\\$violations * 10); echo 'PHPMD Score: ' . \\$score . ' (Violations: ' . \\$violations . ')' . PHP_EOL;\" || echo 'PHPMD not available'", |
40 | 36 | "quality:psalm-score": "./vendor/bin/psalm --output-format=json --no-cache | php -r \"\\$input = file_get_contents('php://stdin'); \\$json = json_decode(\\$input, true); \\$errors = count(\\$json ?? []); \\$score = 1000 - (\\$errors * 5); echo 'Psalm Score: ' . \\$score . ' (Errors: ' . \\$errors . ')' . PHP_EOL;\" || echo 'Psalm not available'", |
|
0 commit comments