[psa] changing format of PRESUBMIT.cfg Hook Scripts

31 views
Skip to first unread message

Mike Frysinger

unread,
Feb 21, 2023, 1:44:40 PM2/21/23
to chromium-os-dev
tl;dr: if you don't edit PRESUBMIT.cfg, you can mute

the PRESUBMIT.cfg Hook Scripts section has long allowed people to write custom shell scripts that execute at repo upload time.  this has literally been shell code: we spawn a shell and execute it using the -c option.  this has the downside of not quoting properly when passing in files that are whitespace delimited.

in practice, very few PRESUBMIT.cfg files relied on this functionality.  the very few that did have been migrated to a standalone shell script that PRESUBMIT.cfg runs.  this has the advantage of being linted and checked for errors by our normal tools.

to address the quoting issues, and simplify in general, we're changing the format.  it will now use shell-like syntax, but not be run through a shell.  this means quoting works as expected, and placeholder variables can be expanded properly.
-mike
Reply all
Reply to author
Forward
0 new messages