summaryrefslogtreecommitdiff
path: root/.gitlab
diff options
context:
space:
mode:
authorKyle Edwards <kyle.edwards@kitware.com>2022-12-09 10:56:49 -0500
committerKyle Edwards <kyle.edwards@kitware.com>2022-12-13 10:29:20 -0500
commit42445b2c049883401d3a70adf1415875c62fc5b8 (patch)
treee70943e2ef3980173a3f3baf7bf0813ca68a550f /.gitlab
parentaf58b6d2ad9a000146e8db2b1c3c74b1a93456ef (diff)
downloadcmake-42445b2c049883401d3a70adf1415875c62fc5b8.tar.gz
ci: run commit messages through codespell
Diffstat (limited to '.gitlab')
-rwxr-xr-x.gitlab/ci/codespell.sh16
-rw-r--r--.gitlab/os-linux.yml2
2 files changed, 17 insertions, 1 deletions
diff --git a/.gitlab/ci/codespell.sh b/.gitlab/ci/codespell.sh
new file mode 100755
index 0000000000..fd052bd0aa
--- /dev/null
+++ b/.gitlab/ci/codespell.sh
@@ -0,0 +1,16 @@
+#!/bin/sh
+
+set -e
+
+result=0
+echo "Running codespell on source code..."
+codespell || result=1
+
+if [ -n "$CI_MERGE_REQUEST_DIFF_BASE_SHA" ]; then
+ for COMMIT in $(git rev-list "^$CI_MERGE_REQUEST_DIFF_BASE_SHA" "$CI_COMMIT_SHA"); do
+ echo "Running codespell on commit message of $COMMIT..."
+ git show --format=%B -s "$COMMIT" | codespell - || result=1
+ done
+fi
+
+exit $result
diff --git a/.gitlab/os-linux.yml b/.gitlab/os-linux.yml
index 8f547cb813..0b8aad97df 100644
--- a/.gitlab/os-linux.yml
+++ b/.gitlab/os-linux.yml
@@ -480,7 +480,7 @@
stage: build
extends: .fedora37
script:
- - codespell
+ - .gitlab/ci/codespell.sh
interruptible: true
.cmake_build_linux: