From aff330eb5b4b1c05ff263dfa060288a8df4c04a8 Mon Sep 17 00:00:00 2001 From: Anthony LC Date: Tue, 18 Mar 2025 09:24:31 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=9A=A8(gitlint)=20Allow=20uppercase=20in?= =?UTF-8?q?=20commit=20messages?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Many developers use uppercase as the first letter in their commit messages, it creates an error. We will allow uppercase in commit messages to lower frustration when committing. --- CHANGELOG.md | 1 + CONTRIBUTING.md | 2 +- gitlint/gitlint_emoji.py | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 135ce035..6eab38c6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,6 +19,7 @@ and this project adheres to - 🧑‍💻(frontend) change literal section open source #702 - ♻️(frontend) replace cors proxy for export #695 +- 🚨(gitlint) Allow uppercase in commit messages #756 ## Fixed diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 20c4e9e1..b56dff19 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -35,7 +35,7 @@ All commit messages must adhere to the following format: * <**gitmoji**>: Use a gitmoji to represent the purpose of the commit. For example, ✨ for adding a new feature or 🔥 for removing something, see the list here: . * **(type)**: Describe the type of change. Common types include `backend`, `frontend`, `CI`, `docker` etc... -* **title**: A short, descriptive title for the change, starting with a lowercase character. +* **title**: A short, descriptive title for the change. * **description**: Include additional details about what was changed and why. ### Example Commit Message diff --git a/gitlint/gitlint_emoji.py b/gitlint/gitlint_emoji.py index 59c86eaf..c8f7024f 100644 --- a/gitlint/gitlint_emoji.py +++ b/gitlint/gitlint_emoji.py @@ -31,7 +31,7 @@ class GitmojiTitle(LineRule): "https://raw.githubusercontent.com/carloscuesta/gitmoji/master/packages/gitmojis/src/gitmojis.json" ).json()["gitmojis"] emojis = [item["emoji"] for item in gitmojis] - pattern = r"^({:s})\(.*\)\s[a-z].*$".format("|".join(emojis)) + pattern = r"^({:s})\(.*\)\s[a-zA-Z].*$".format("|".join(emojis)) if not re.search(pattern, title): violation_msg = 'Title does not match regex "() "' return [RuleViolation(self.id, violation_msg, title)]