mirror of
https://gitlab.com/lvra/lvra.gitlab.io.git
synced 2024-12-25 07:10:25 +01:00
feat: check for trailing spaces in CI
This commit is contained in:
parent
83eca43460
commit
13360a21f0
2 changed files with 13 additions and 0 deletions
|
@ -6,6 +6,10 @@ test-links:
|
||||||
script:
|
script:
|
||||||
- python3 ./test_links.py
|
- python3 ./test_links.py
|
||||||
|
|
||||||
|
test-trailing-spaces:
|
||||||
|
script:
|
||||||
|
- ./test_trailing_spaces.sh
|
||||||
|
|
||||||
test-build:
|
test-build:
|
||||||
image: registry.gitlab.com/pages/hugo/hugo_extended
|
image: registry.gitlab.com/pages/hugo/hugo_extended
|
||||||
script:
|
script:
|
||||||
|
|
9
test_trailing_spaces.sh
Executable file
9
test_trailing_spaces.sh
Executable file
|
@ -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
|
Loading…
Reference in a new issue