mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
Fix and create code-smell test for line endings.
This commit is contained in:
parent
66a0b1475f
commit
469c4a106b
3 changed files with 24 additions and 11 deletions
12
test/sanity/code-smell/line-endings.sh
Executable file
12
test/sanity/code-smell/line-endings.sh
Executable file
|
@ -0,0 +1,12 @@
|
|||
#!/bin/sh
|
||||
|
||||
grep -RIPl '\r' . 2>/dev/null \
|
||||
--exclude-dir .git \
|
||||
| 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
|
|
@ -21,6 +21,7 @@ test/sanity/code-smell/use-compat-six.sh lib
|
|||
test/sanity/code-smell/boilerplate.sh
|
||||
test/sanity/code-smell/required-and-default-attributes.sh
|
||||
test/sanity/code-smell/shebang.sh
|
||||
test/sanity/code-smell/line-endings.sh
|
||||
|
||||
shellcheck \
|
||||
test/integration/targets/*/*.sh \
|
||||
|
|
Loading…
Reference in a new issue