utils/analytics: revert a test-bot analytics change.

https://github.com/Homebrew/brew/pull/17154#discussion_r1581102553 was
ignored by auto-merge, whoops.
This commit is contained in:
Mike McQuaid 2024-04-26 15:24:12 +01:00
parent af0f115a23
commit ecd96a2c51
No known key found for this signature in database

View File

@ -144,23 +144,13 @@ module Utils
os: HOMEBREW_SYSTEM, os: HOMEBREW_SYSTEM,
} }
command_and_package, options =
step_command_short.split
.partition { |arg| !arg.start_with?("-") }
# Strip out any flag values to reduce cardinality and preserve privacy. # Strip out any flag values to reduce cardinality and preserve privacy.
# Sort options to ensure consistent ordering and improve readability. # Sort options to ensure consistent ordering and improve readability.
options = options.join(" ") command_and_package, options =
.split step_command_short.split
.join(" ") .map { |arg| arg.sub(/=.*/, "=") }
.split(/(-+)/) .partition { |arg| !arg.start_with?("-") }
.map { |a| a.sub(/[ =].+/, " ") } command = (command_and_package + options.sort).join(" ")
.join(" ")
.strip
.split
.sort
command = (command_and_package + options).join(" ")
# Fields can have high cardinality. # Fields can have high cardinality.
fields = { command: } fields = { command: }