ansible/test/sanity/code-smell/no-smart-quotes.sh
Matt Clay e0010f15e4 Add pslint sanity test. (#35303)
* Add pslint sanity test.

* Fix `no-smart-quotes` sanity test.

* Add docs for `pslint` sanity test.
2018-01-24 17:22:14 -08:00

24 lines
857 B
Bash
Executable file
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/bin/sh
# shellcheck disable=SC1015,SC1016
egrep -r '[‘’“”]' . \
--exclude-dir .git \
--exclude-dir .tox \
--exclude-dir __pycache__ \
| grep -v \
-e './test/sanity/code-smell/no-smart-quotes.sh' \
-e './docs/docsite/rst/dev_guide/testing/sanity/no-smart-quotes.rst' \
-e './test/integration/targets/unicode/unicode.yml' \
-e '\.doctree matches$' \
-e '\.pickle matches$' \
-e './docs/docsite/_build/html/'
if [ $? -ne 1 ]; then
printf 'The file(s) listed above have non-ascii quotes.\n'
# shellcheck disable=SC1015,SC1016
printf 'Make sure all files use " and '"'"' as quotation marks\n'
printf 'These sed commands may be of help to you:\n'
# shellcheck disable=SC1015,SC1016
printf " sed 's/[”“]/\"/g' \$FILENAME -i && sed \"s/[]/'/g\" \$FILENAME -i\\n"
exit 1
fi