ansible/test/sanity/code-smell/line-endings.sh
Matt Clay 912d6ed8cc Clean up code-smell sanity scripts. (#18407)
- Replace find ';' with '+' for faster execution.
- Replace grep -R with -r to avoid recursive warnings.
- Exclude .git and .tox directories from recursive grep.
- Improve messaging on failed sanity checks.
- Add no-basestring check to Shippable.
2016-11-07 16:46:33 -08:00

13 lines
373 B
Bash
Executable file

#!/bin/sh
grep -rIPl '\r' . \
--exclude-dir .git \
--exclude-dir .tox \
| grep -v -F \
-e './test/integration/targets/win_regmerge/templates/win_line_ending.j2'
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