Skip to content

Commit ccd58c5

Browse files
swissspidyclaude
andcommitted
Let an explicit --report win over the quiet one in the PHPCS runner
WP_CLI_TEST_QUIET is meant to be exported once and left set, so it has to stay out of the way of a report asked for on the command line. It did not: PHPCS gives no way for a later --report to replace an earlier one, so composer phpcs -- --report=summary printed both reports on 3.x and only the injected emacs one on 4.x. The compact report is now skipped when the caller names a report of their own. -q stays either way, since a later -v does override it. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01GjJi6F76YZBt7cRrvXS6s6
1 parent a444f0d commit ccd58c5

1 file changed

Lines changed: 10 additions & 1 deletion

File tree

‎bin/run-phpcs-tests‎

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,16 @@ then
99
# Useful for CI logs and for AI coding agents, which pay for every token of
1010
# the report they read back.
1111
if [ -n "${WP_CLI_TEST_QUIET}" ]; then
12-
EXTRA_ARGS="-q --report=emacs"
12+
EXTRA_ARGS="-q"
13+
14+
# A report asked for on the command line wins. PHPCS does not let a
15+
# later --report replace an earlier one -- 3.x prints both reports and
16+
# 4.x keeps only the first it saw -- so the compact one has to stay out
17+
# of the way rather than rely on ordering.
18+
case " $* " in
19+
*" --report="*|*" --report-"*) ;;
20+
*) EXTRA_ARGS="${EXTRA_ARGS} --report=emacs" ;;
21+
esac
1322
fi
1423

1524
# shellcheck disable=SC2086 # Intentional word splitting of the optional arguments.

0 commit comments

Comments
 (0)