You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
ansible/test/sanity/code-smell/line-endings.sh

16 lines
509 B
Bash

#!/bin/sh
grep -rIPl '\r' . \
--exclude-dir .git \
--exclude-dir .tox \
| grep -v -F \
-e './test/integration/targets/template/files/foo.dos.txt' \
-e './test/integration/targets/win_regmerge/templates/win_line_ending.j2' \
-e './test/integration/targets/win_template/files/foo.dos.txt' \
if [ $? -ne 1 ]; then
printf 'One or more file(s) listed above have invalid line endings.\n'
printf 'Make sure all files use "\\n" for line endings instead of "\\r\\n".\n'
exit 1
fi