summaryrefslogtreecommitdiffstats
path: root/.gitlab/ci/codespell.sh
blob: fd052bd0aa24aedbdfbacdce36541219e09b5fef (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
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