Add flags to disable BUG= and TEST= checks

Commits in some upstream-targeted repositories need to follow upstream
commit message conventions, and thus should not have the BUG= and TEST=
fields.  Add new bug_field_check and test_field_check options to support
disabling those from a repo's PRESUBMIT.cfg configuration.

BUG=None
TEST=Set up a PRESUBMIT.cfg with the new options; verify that the hook
     passes with no BUG or TEST.

Change-Id: I8843bff80bbf98c491642a91672f0aec46632437
Reviewed-on: https://chromium-review.googlesource.com/196681
Tested-by: Josh Triplett <josh@joshtriplett.org>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Commit-Queue: Josh Triplett <josh@joshtriplett.org>
diff --git a/disable_cros_style_checks/PRESUBMIT.cfg b/disable_cros_style_checks/PRESUBMIT.cfg
index 51d8dd6..2e562e2 100644
--- a/disable_cros_style_checks/PRESUBMIT.cfg
+++ b/disable_cros_style_checks/PRESUBMIT.cfg
@@ -6,4 +6,5 @@
 long_line_check: false
 cros_license_check: false
 tab_check: false
-
+bug_field_check: false
+test_field_check: false
diff --git a/pre-upload.py b/pre-upload.py
index 650ec3f..61e7e7e 100755
--- a/pre-upload.py
+++ b/pre-upload.py
@@ -876,6 +876,8 @@
     'tab_check': _check_no_tabs,
     'branch_check': _check_change_has_branch_field,
     'signoff_check': _check_change_has_signoff_field,
+    'bug_field_check': _check_change_has_bug_field,
+    'test_field_check': _check_change_has_test_field,
 }