mirror of
https://github.com/containous/traefik.git
synced 2025-01-05 09:17:52 +03:00
30 lines
650 B
Bash
Executable File
30 lines
650 B
Bash
Executable File
#!/usr/bin/env bash
|
|
|
|
IFS=$'\n'
|
|
files=( $( git ls-files 'docs/*.md' *.md ) )
|
|
unset IFS
|
|
|
|
errors=()
|
|
for f in "${files[@]}"; do
|
|
# we use source text here so we also check spelling of variable names
|
|
failedSpell=$(misspell -source=text "$f")
|
|
if [ "$failedSpell" ]; then
|
|
errors+=( "$failedSpell" )
|
|
fi
|
|
done
|
|
|
|
if [ ${#errors[@]} -eq 0 ]; then
|
|
echo 'Congratulations! All Go source files and docs have been checked for common misspellings.'
|
|
else
|
|
{
|
|
echo "Errors from misspell:"
|
|
for err in "${errors[@]}"; do
|
|
echo "$err"
|
|
done
|
|
echo
|
|
echo 'Please fix the above errors. You can test via "misspell" and commit the result.'
|
|
echo
|
|
} >&2
|
|
false
|
|
fi
|