-
-
Notifications
You must be signed in to change notification settings - Fork 94
Description
This has been a long-standing source of confusion for us and repeatedly comes up whenever developers switch from IDE-integrated PHPCS to command-line usage.
The current behavior appears counter-intuitive:
--report=source produces what most developers would expect to be a summary of issues.
--report=summary produces what most developers would expect to be a per-source (per-file) breakdown.
In practice, developers regularly assume the opposite based on the report names. The mismatch is confusing enough that we ended up adding a small shell wrapper in our projects which swaps the arguments to match expectations.
I was unable to find an existing issue about this, so I'm opening one here. With the new maintainer and the recent activity giving the project fresh momentum, this might be a good opportunity to revisit this long-standing naming inconsistency.
Proposed solution
Changing the current behavior directly would be BC breaking and therefor would require a new major release. Deferring this to v5 doesn't seem practical. As a non-breaking fix for v4.x, I'd propose introducing an opt-in runtime argument (and equivalent XML setting), for example:
--report-names=legacy|fixed
legacy: the current behavior (default).fixed: swap the internal mapping so thatsourceandsummarymatch their intuitive meaning.
This would allow projects to migrate gradually without breaking CI setups or tooling. In v5, the default could then be switched to fixed, and the legacy mode eventually be deprecated.
edit: I'm willing to work on a PR if this update is appreciated.