diff options
author | Brad King <brad.king@kitware.com> | 2022-12-14 14:04:01 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2022-12-14 14:04:14 (GMT) |
commit | dcb1c9c080d9dc7231893baf8bd71713ed2fe021 (patch) | |
tree | 49cac4a8e395db04aff166441cb45b80347ebab9 /.gitlab/ci | |
parent | 84c2518a7bfa9a05f658c14bde0e9494508e30ed (diff) | |
parent | 42445b2c049883401d3a70adf1415875c62fc5b8 (diff) | |
download | CMake-dcb1c9c080d9dc7231893baf8bd71713ed2fe021.zip CMake-dcb1c9c080d9dc7231893baf8bd71713ed2fe021.tar.gz CMake-dcb1c9c080d9dc7231893baf8bd71713ed2fe021.tar.bz2 |
Merge topic 'codespell-commit-message'
42445b2c04 ci: run commit messages through codespell
Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Alex <leha-bot@yandex.ru>
Merge-request: !8007
Diffstat (limited to '.gitlab/ci')
-rwxr-xr-x | .gitlab/ci/codespell.sh | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/.gitlab/ci/codespell.sh b/.gitlab/ci/codespell.sh new file mode 100755 index 0000000..fd052bd --- /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 |