Raise Infection from no-op to enforced signal and cover newly exposed mutation gaps#54
Raise Infection from no-op to enforced signal and cover newly exposed mutation gaps#54
Conversation
Agent-Logs-Url: https://github.com/voku/Stringy/sessions/2c8029b4-d144-46a7-b8a3-25148223b5ec Co-authored-by: voku <264695+voku@users.noreply.github.com>
Agent-Logs-Url: https://github.com/voku/Stringy/sessions/2c8029b4-d144-46a7-b8a3-25148223b5ec Co-authored-by: voku <264695+voku@users.noreply.github.com>
Agent-Logs-Url: https://github.com/voku/Stringy/sessions/2c8029b4-d144-46a7-b8a3-25148223b5ec Co-authored-by: voku <264695+voku@users.noreply.github.com>
Agent-Logs-Url: https://github.com/voku/Stringy/sessions/2c8029b4-d144-46a7-b8a3-25148223b5ec Co-authored-by: voku <264695+voku@users.noreply.github.com>
Agent-Logs-Url: https://github.com/voku/Stringy/sessions/66d485bc-1215-40ee-be1b-89dc3284da01 Co-authored-by: voku <264695+voku@users.noreply.github.com>
Agent-Logs-Url: https://github.com/voku/Stringy/sessions/66d485bc-1215-40ee-be1b-89dc3284da01 Co-authored-by: voku <264695+voku@users.noreply.github.com>
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request introduces mutation testing configuration via infection.json.dist and expands the test suite to cover default behaviors for the create, appendStringy, words, and chunk methods. It also refines existing tests by adding exception message checks and ensuring cache resets during static analysis testing. Feedback was provided regarding the static analysis suppression in CollectionStringy.php, suggesting the addition of an explanatory marker for better clarity and consistency with the rest of the codebase.
| string $iteratorClass = \Arrayy\ArrayyIterator::class, | ||
| bool $checkPropertiesInConstructor = true | ||
| ) { | ||
| /** @phpstan-ignore-next-line */ |
There was a problem hiding this comment.
The use of a broad /** @phpstan-ignore-next-line */ without an explanatory comment is discouraged as it can hide unrelated static analysis issues on the same line. For consistency with other ignores in this file (e.g., lines 95 and 110), consider adding a brief explanation or a marker like | FP? to indicate why this suppression is necessary.
/** @phpstan-ignore-next-line | FP? */|
@copilot PS: upfront my two cent, since version 2 of phpstan we can and should use suppress errors by identifier and not per line anymore! Now your task, check if the next llm generated feedback is valid or just AI slop: Code Review src/CollectionStringy.php The use of a broad /** @phpstan-ignore-next-line */ without an explanatory comment is discouraged as it can hide unrelated static analysis issues on the same line. For consistency with other ignores in this file (e.g., lines 95 and 110), consider adding a brief explanation or a marker like | FP? to indicate why this suppression is necessary. |
Agent-Logs-Url: https://github.com/voku/Stringy/sessions/5652f31c-3d0b-41ba-aeb9-bc0f5be2420e Co-authored-by: voku <264695+voku@users.noreply.github.com>
The feedback was valid. I reproduced the suppressed PHPStan error, confirmed the identifier is |
The Infection job was effectively non-blocking and under-configured: CI accepted any MSI, and PHPStan integration was memory-constrained enough to blur real signal. This PR tightens the mutation gate to the current measured baseline and adds targeted regression coverage for escaped mutants surfaced by the stricter run.
Infection policy
/home/runner/work/Stringy/Stringy/infection.json.distminMsi: 87minCoveredMsi: 87staticAnalysisToolOptions: "--memory-limit=512M"so PHPStan-backed mutation analysis remains usable under InfectionCI behavior
--min-msi=0 --min-covered-msi=0Regression coverage for escaped mutants
StaticStringyTestmethodArgsmap before validating__callStatic()argument countingCollectionStringyTestCollectionStringy::create()still enforces element type validation by defaultStringyTestappendStringy()words()chunk()andchunkCollection()Net effect
{ "staticAnalysisTool": "phpstan", "staticAnalysisToolOptions": "--memory-limit=512M", "minMsi": 87, "minCoveredMsi": 87 }This change is