Skip to content

Commit 1c15557

Browse files
committed
fix(ci): remove sed workarounds — devkit now generates correct phpunit config
The root fix is in kariricode-devkit (PhpUnitConfigGenerator.php): - failOnWarning="false" (was true) - failOnRisky="false" (was true) - <source> without restrict* attributes (removed restrictDeprecations/ restrictNotices/restrictWarnings) All 'Patch phpunit.xml.dist' steps with sed commands are no longer needed. Also reverts devkit.php coverage_exclude — DiscoveryException coverage should remain tracked (the warning is now suppressed properly by the devkit).
1 parent f4c242a commit 1c15557

3 files changed

Lines changed: 1 addition & 36 deletions

File tree

.github/workflows/ci.yml

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -43,19 +43,6 @@ jobs:
4343
- name: Initialize devkit (.kcode/ generation)
4444
run: kcode init
4545

46-
# Patch generated phpunit.xml.dist — the devkit regenerates this file on every
47-
# `kcode init` run, so patches must be applied here after initialization.
48-
# Suppresses PHPUnit 12 false-positive warnings/notices/risky flags that do not
49-
# reflect actual defects in this library (ARFA 1.3 compliance preserved).
50-
- name: Patch phpunit.xml.dist
51-
run: |
52-
sed -i 's/failOnWarning="true"/failOnWarning="false"/' .kcode/phpunit.xml.dist
53-
sed -i 's/failOnRisky="true"/failOnRisky="false"/' .kcode/phpunit.xml.dist
54-
sed -i 's/beStrictAboutCoverageMetadata="true"/beStrictAboutCoverageMetadata="false"/' .kcode/phpunit.xml.dist
55-
sed -i 's/ restrictWarnings="true"//g' .kcode/phpunit.xml.dist
56-
sed -i 's/ restrictDeprecations="true"//g' .kcode/phpunit.xml.dist
57-
sed -i 's/ restrictNotices="true"//g' .kcode/phpunit.xml.dist
58-
5946
# cs-fixer → phpstan (L9) → psalm → phpunit
6047
# Exit code ≠ 0 fails the job (zero-tolerance policy)
6148
- name: Run full quality pipeline

.github/workflows/code-quality.yml

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -94,17 +94,6 @@ jobs:
9494
- name: Initialize devkit
9595
run: kcode init
9696

97-
# Patch generated phpunit.xml.dist — disable failOnWarning and strict
98-
# coverage metadata to avoid false-positive warnings from PHPUnit 12.
99-
- name: Patch phpunit.xml.dist
100-
run: |
101-
sed -i 's/failOnWarning="true"/failOnWarning="false"/' .kcode/phpunit.xml.dist
102-
sed -i 's/failOnRisky="true"/failOnRisky="false"/' .kcode/phpunit.xml.dist
103-
sed -i 's/beStrictAboutCoverageMetadata="true"/beStrictAboutCoverageMetadata="false"/' .kcode/phpunit.xml.dist
104-
sed -i 's/ restrictWarnings="true"//g' .kcode/phpunit.xml.dist
105-
sed -i 's/ restrictDeprecations="true"//g' .kcode/phpunit.xml.dist
106-
sed -i 's/ restrictNotices="true"//g' .kcode/phpunit.xml.dist
107-
10897
# Runs PHPStan Level 9 then Psalm sequentially — both must pass
10998
- name: Run PHPStan + Psalm via kcode
11099
run: kcode analyse
@@ -171,17 +160,6 @@ jobs:
171160
- name: Initialize devkit
172161
run: kcode init
173162

174-
# Patch generated phpunit.xml.dist — disable failOnWarning and strict
175-
# coverage metadata to avoid false-positive warnings from PHPUnit 12.
176-
- name: Patch phpunit.xml.dist
177-
run: |
178-
sed -i 's/failOnWarning="true"/failOnWarning="false"/' .kcode/phpunit.xml.dist
179-
sed -i 's/failOnRisky="true"/failOnRisky="false"/' .kcode/phpunit.xml.dist
180-
sed -i 's/beStrictAboutCoverageMetadata="true"/beStrictAboutCoverageMetadata="false"/' .kcode/phpunit.xml.dist
181-
sed -i 's/ restrictWarnings="true"//g' .kcode/phpunit.xml.dist
182-
sed -i 's/ restrictDeprecations="true"//g' .kcode/phpunit.xml.dist
183-
sed -i 's/ restrictNotices="true"//g' .kcode/phpunit.xml.dist
184-
185163
- name: Run tests with coverage (pcov)
186164
run: kcode test --coverage
187165

devkit.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
// ],
4444

4545
// ── Coverage ──────────────────────────────────────────────
46-
'coverage_exclude' => ['src/Exception'],
46+
// 'coverage_exclude' => ['src/Exception'],
4747

4848
// ── Code Style (MERGED with KaririCode defaults) ──────────
4949
// 'cs_fixer_rules' => [

0 commit comments

Comments
 (0)