diff --git a/bin/tools/git-find-non-ascii b/bin/tools/git-find-non-ascii new file mode 100755 index 0000000000..8a733a2238 --- /dev/null +++ b/bin/tools/git-find-non-ascii @@ -0,0 +1,23 @@ +#!/bin/sh +#------------------------------------------------------------------------------ +# Script +# git-find-non-ascii +# +# Description +# Use git grep to find source files with non-ASCII characters. +# Use cached files for speed. +# +# C files: .c .h +# C++ files: .C .cc .cpp .cxx .H .hh .hpp .hxx +# +#------------------------------------------------------------------------------ + +git grep --cached --line-number -P '[\x00-\x08\x0E-\x1F\x80-\xFF]' + -- \ + '*.[CHch]' \ + '*.cc' \ + '*.hh' \ + '*.[ch]pp' \ + '*.[ch]xx' + +#------------------------------------------------------------------------------ diff --git a/bin/tools/git-find-trailingspace b/bin/tools/git-find-trailingspace index 9531918e30..88e1672bc8 100755 --- a/bin/tools/git-find-trailingspace +++ b/bin/tools/git-find-trailingspace @@ -8,6 +8,6 @@ # #------------------------------------------------------------------------------ -git grep --count -P '\s+$' -- $@ +git grep --count -P '\s+$' -- "$@" #------------------------------------------------------------------------------