Add a clang-format pre-upload hook

This change converts adds the `clang_format_check` pre-upload hook,
modelled after the one in AOSP's repohooks. This is disabled by default,
and all projects must opt in to enable it.

  [Hook Overrides]
  clang_format_check: true

  # Optional if you need to limit clang-format to just a few projects.
  # e.g. for platform2/
  [Hook Overrides Options]
  clang_format_check: project_a/ project_b/

CQ-DEPEND=CL:688744,CL:*464767
BUG=b:65376611
TEST=../repohooks/pre-upload.py  # On platform2 with a badly-formatted
                                 # change.

Change-Id: I088a9f8585e74d3d0db3b647febdecdbf79f3d03
Reviewed-on: https://chromium-review.googlesource.com/685283
Commit-Ready: Luis Hector Chavez <lhchavez@chromium.org>
Tested-by: Luis Hector Chavez <lhchavez@chromium.org>
Reviewed-by: Dan Erat <derat@chromium.org>
2 files changed