ansible/test/sanity/code-smell/line-endings.sh
Dag Wieers ac43a1bbbc Windows: Use the correct newline sequence for the platform (#21846)
This change to the template action plugin make template use the
platform's native newline_sequence for Jinja.

We also added the option `newline_sequence` to change the newline
sequence using by Jinja if you need to use another newline sequence than
the platform default.

This was previously discussed in
https://github.com/ansible/ansible/issues/16255#issuecomment-278289414

And also relates to issue #21128
2017-03-23 19:47:10 -07:00

15 lines
509 B
Bash
Executable file

#!/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