summaryrefslogtreecommitdiff
path: root/.gitlab-ci
diff options
context:
space:
mode:
authorCarlos Garnacho <carlosg@gnome.org>2022-02-19 11:36:42 +0100
committerCarlos Garnacho <carlosg@gnome.org>2022-03-08 11:31:15 +0100
commitca35a190e5aff1bafeae05f586ae098ad3a5762b (patch)
treee7e3c68c5c4a6182c1bb31ca3bfad2f4285b6951 /.gitlab-ci
parent3cf7b1613fb51e0558cfd3d088063f0ca55e0524 (diff)
downloadtracker-ca35a190e5aff1bafeae05f586ae098ad3a5762b.tar.gz
ci: Add some additional commit formatting rules
For ci-fairy check-commits to pick it up. These are mostly cosmetic: - Require that the commit subject has a prefix - Prevent commits from having links to the merge request itself (should be already there via merge commits) - Ensure commit subjects are properly capitalized - Avoid code filenames in commit subject We could add some further things in the future, like enforcing a set of prefixes to use in commit log subjects.
Diffstat (limited to '.gitlab-ci')
-rw-r--r--.gitlab-ci/commit-rules.yml13
1 files changed, 13 insertions, 0 deletions
diff --git a/.gitlab-ci/commit-rules.yml b/.gitlab-ci/commit-rules.yml
new file mode 100644
index 000000000..fbd78a35d
--- /dev/null
+++ b/.gitlab-ci/commit-rules.yml
@@ -0,0 +1,13 @@
+patterns:
+ require:
+ - regex: '^[^:]+: +[^ ]'
+ message: "Commit message subject must have a prefix. E.g. 'tests: '"
+ deny:
+ - regex: '^$CI_MERGE_REQUEST_PROJECT_URL/(-/)?merge_requests/$CI_MERGE_REQUEST_IID$'
+ message: "Commit message must not contain a link to its own merge request"
+ - regex: '^[^:]+: [a-z]'
+ message: "Commit message subject should be properly Capitalized. E.g. 'cli: Fix help subcommand'"
+ where: subject
+ - regex: '^\S*\.[ch]:'
+ message: Commit message subject prefix should not include .c, .h, etc.
+ where: subject