Skip to content

armgit / meet

Public Imported from GitHub
0

Open source video conferencing app powered by LiveKit. Built with Django and React.

🔒️(ci) escape the downloaded gitmojis before the regex

davd-gzl02a355136f5c
diff --git a/gitlint/gitlint_emoji.py b/gitlint/gitlint_emoji.py
index f8306b65..f98d4f1a 100644
--- a/gitlint/gitlint_emoji.py
+++ b/gitlint/gitlint_emoji.py
@@ -30,7 +30,7 @@ class GitmojiTitle(LineRule):
"""
with urllib.request.urlopen(GITMOJIS_URL, timeout=10) as response:
gitmojis = json.load(response)["gitmojis"]
- emojis = [item["emoji"] for item in gitmojis]
+ emojis = [re.escape(item["emoji"]) for item in gitmojis]
pattern = r"^({:s})\(.*\)\s[a-z].*$".format("|".join(emojis))
if not re.search(pattern, title):
violation_msg = 'Title does not match regex "<gitmoji>(<scope>) <subject>"'