ci: run commit messages through codespell

This commit is contained in:
Kyle Edwards 2022-12-09 10:56:49 -05:00
parent af58b6d2ad
commit 42445b2c04
2 changed files with 17 additions and 1 deletions

16
.gitlab/ci/codespell.sh Executable file
View File

@ -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

View File

@ -480,7 +480,7 @@
stage: build
extends: .fedora37
script:
- codespell
- .gitlab/ci/codespell.sh
interruptible: true
.cmake_build_linux: