diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index fe610f5..2aeec04 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -6,6 +6,10 @@ test-links: script: - python3 ./test_links.py +test-trailing-spaces: + script: + - ./test_trailing_spaces.sh + test-build: image: registry.gitlab.com/pages/hugo/hugo_extended script: diff --git a/test_trailing_spaces.sh b/test_trailing_spaces.sh new file mode 100755 index 0000000..f29644c --- /dev/null +++ b/test_trailing_spaces.sh @@ -0,0 +1,9 @@ +#!/bin/bash + +TRAILING_SPACES=$(find content -name '*.md' -exec grep -EHn ' +$' {} \;) + +if [[ -n "$TRAILING_SPACES" ]]; then + echo "Error: these files have trailing spaces!" + echo "$TRAILING_SPACES" + exit 1 +fi