pre-upload: allow repos to pass in custom options to hooks

Currently you can enable hooks in PRESUBMIT.cfg, but not tweak their
behavior.  A dedicated hook name would have to be created.  Instead,
let people pass in an open ended set of options that'll get passed to
the hook and it can do what it wants.

For example, you can enable checkpatch in a repo:
[Hook Overrides]
checkpatch_check: true

And you can pass in specific checkpatch options:
[Hook Overrides Options]
checkpatch_check: --no-tree --ignore=MSLEEP,VOLATILE

BUG=chromium:466264
TEST=`./pre-upload_unittest.py` passes

Change-Id: Ia9f09ecabb6f44785fcf8b78c2d0f8f1d003cea0
Reviewed-on: https://chromium-review.googlesource.com/262396
Reviewed-by: Vadim Bendebury <vbendeb@chromium.org>
Reviewed-by: Steve Fung <stevefung@chromium.org>
Commit-Queue: Mike Frysinger <vapier@chromium.org>
Tested-by: Mike Frysinger <vapier@chromium.org>
1 file changed