Skip to content

Commit

Permalink
fixup! DX: Check trailing spaces in project files only
Browse files Browse the repository at this point in the history
lets not loose colors and pass on the rainbow flag.

find prefixes "./"; git ls-files does not.
  • Loading branch information
ktomk committed May 16, 2020
1 parent 9d04900 commit c28322d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion check_trailing_spaces.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ if [ "$files_with_trailing_spaces" ]
then
printf '\033[97;41mTrailing whitespaces detected:\033[0m\n'
e=$(printf '\033')
echo "${files_with_trailing_spaces}" | sed -E "s/^\\.\\/([^:]+):([0-9]+):(.*[^\\t ])?([\\t ]+)$/${e}[0;31m - in ${e}[0;33m\\1${e}[0;31m at line ${e}[0;33m\\2\\n ${e}[0;31m>${e}[0m \\3${e}[41;1m\\4${e}[0m/"
echo "${files_with_trailing_spaces}" | sed -E "s/^([^:]+):([0-9]+):(.*[^\\t ])?([\\t ]+)$/${e}[0;31m - in ${e}[0;33m\\1${e}[0;31m at line ${e}[0;33m\\2\\n ${e}[0;31m>${e}[0m \\3${e}[41;1m\\4${e}[0m/"

exit 3
fi
Expand Down

0 comments on commit c28322d

Please sign in to comment.