Config: bug fix - "reports" could get set incorrectly when in CBF mode #1077
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
There are three CLI arguments related to the reporting:
--report=[comma separated list]
--report-file=[path to file]
--report-<type>=[path to file]
The
--report-file...
option is ignored when in CBF mode. Whether that is the correct behaviour or not, is outside the scope of the current bug fix.In the
Config::processLongArgument()
method, the--report-file
option is handled before the--report-<type>
option to ensure that--report-file
is handled correctly, as the handling of the--report-<type>
argument is based on seeing the prefix--report-
, which overlaps with--report-file
.However, this logic was broken in CBF mode, as in that case, the
--report-file
CLI arg would still fall through to the--report-<type>
handling, which would break the setting of the$reports
.Fixed now.
Includes tests specifically for this issue.
This is a logic bug only and had no impact on end-users, as the
Runner::runPHPCBF()
method includes a hard-coded overrule of thereportFile
andreport
settings.Suggested changelog entry
N/A