osmith has submitted this change. ( https://gerrit.osmocom.org/c/osmo-ci/+/43445?usp=email )
Change subject: lint: checkpatch: escape gerrit markdown chars
......................................................................
lint: checkpatch: escape gerrit markdown chars
Fix that some messages look wrong in gerrit, for example:
"foo* bar" should be "foo *bar"
The asterisk symbols would be removed and the text between them would be
displayed in cursive.
Example: https://gerrit.osmocom.org/c/libosmocore/+/43443/comment/ad7b209c_7b2929c1/
Change-Id: Ic9cf1705fc17873c90b57725227a1a6a3d4cd699
---
M lint/checkpatch/checkpatch_json.py
1 file changed, 9 insertions(+), 1 deletion(-)
Approvals:
fixeria: Looks good to me, approved
Jenkins Builder: Verified
diff --git a/lint/checkpatch/checkpatch_json.py b/lint/checkpatch/checkpatch_json.py
index c4ea3b0..c35c4f3 100755
--- a/lint/checkpatch/checkpatch_json.py
+++ b/lint/checkpatch/checkpatch_json.py
@@ -16,6 +16,14 @@
list_temp = {}
+def gerrit_markdown_escape(msg):
+ """Escape characters that would get interpreted as markdown syntax in
+ gerrit comments. For example: "foo* bar" should be "foo *bar" """
+ msg = msg.replace("*", "\\*")
+ msg = msg.replace("`", "\\`")
+ return msg
+
+
def update_struct(file_path, msg_output, line_number):
if file_path not in list_temp:
list_temp[file_path] = []
@@ -24,7 +32,7 @@
"robot_run_id": sys.argv[3],
"url": sys.argv[4],
"line": line_number,
- "message": msg_output,
+ "message": gerrit_markdown_escape(msg_output),
}
if error not in list_temp[file_path]:
list_temp[file_path].append(error)
--
To view, visit https://gerrit.osmocom.org/c/osmo-ci/+/43445?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: merged
Gerrit-Project: osmo-ci
Gerrit-Branch: master
Gerrit-Change-Id: Ic9cf1705fc17873c90b57725227a1a6a3d4cd699
Gerrit-Change-Number: 43445
Gerrit-PatchSet: 1
Gerrit-Owner: osmith <osmith(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: osmith <osmith(a)sysmocom.de>
Attention is currently required from: osmith.
pespin has posted comments on this change by osmith. ( https://gerrit.osmocom.org/c/osmo-ci/+/43444?usp=email )
Change subject: lint/checkpatch/checkpatch_json: format with ruff
......................................................................
Patch Set 1: Code-Review+2
--
To view, visit https://gerrit.osmocom.org/c/osmo-ci/+/43444?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: osmo-ci
Gerrit-Branch: master
Gerrit-Change-Id: Ie67fce9de101fd58db0af4e5fe54922a54ce2c9b
Gerrit-Change-Number: 43444
Gerrit-PatchSet: 1
Gerrit-Owner: osmith <osmith(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: osmith <osmith(a)sysmocom.de>
Gerrit-Comment-Date: Mon, 31 Aug 2026 09:13:17 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes