summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndré Draszik <draszik@google.com>2023-01-24 16:03:19 +0000
committerWill McVicker <willmcvicker@google.com>2023-05-03 14:40:26 -0700
commit54f0f8b88cb8e3e2981118310f72ae901a37ffc5 (patch)
treeaf448b57a4e620c201124d4c3b51ecf87c8bc71b
parent270cc03a121d7bcc0f4381143cb662256c5c0146 (diff)
downloadbcm4389-54f0f8b88cb8e3e2981118310f72ae901a37ffc5.tar.gz
PREUPLOAD: add repo upload hook
This will cause repo upload to run checkpatch first, so as to spot issues early, i.e. before presubmit failures in gerrit. Test: .../tools/repohooks/pre-upload.py Bug: 266563427 Change-Id: Ie8548e7fa6104ddd04b50b4d10b7e99b0813d3d4 Signed-off-by: André Draszik <draszik@google.com> Signed-off-by: Will McVicker <willmcvicker@google.com>
-rw-r--r--.checkpatch.conf21
-rw-r--r--PREUPLOAD.cfg11
2 files changed, 32 insertions, 0 deletions
diff --git a/.checkpatch.conf b/.checkpatch.conf
new file mode 100644
index 0000000..3c35612
--- /dev/null
+++ b/.checkpatch.conf
@@ -0,0 +1,21 @@
+# SPDX-License-Identifier: GPL-2.0-only
+#
+# The configs of the Linux checkpatch script
+#
+# Copyright (c) 2023 Google LLC
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 as
+# published by the Free Software Foundation.
+
+# Showing the diff position is clearer with git-based information
+--showfile
+
+# The Change-Id line is always reserved before submitting
+--ignore GERRIT_CHANGE_ID
+
+# The MAINTAINERS file patterns are not used in current gerrit
+--ignore FILE_PATH_CHANGES
+
+# otherwise it's impossible to add e.g. http-links to commit messages
+--ignore COMMIT_LOG_LONG_LINE
diff --git a/PREUPLOAD.cfg b/PREUPLOAD.cfg
new file mode 100644
index 0000000..fce1d19
--- /dev/null
+++ b/PREUPLOAD.cfg
@@ -0,0 +1,11 @@
+[Options]
+ignore_merged_commits = true
+
+[Builtin Hooks]
+checkpatch = true
+commit_msg_bug_field = true
+commit_msg_changeid_field = true
+commit_msg_test_field = true
+
+[Builtin Hooks Options]
+checkpatch = --root ${REPO_ROOT}/common