ENH: bin/tools/git-find-non-ascii: find non-ASCII chars in source code
This commit is contained in:
parent
0e6df58c70
commit
916dcc85a5
23
bin/tools/git-find-non-ascii
Executable file
23
bin/tools/git-find-non-ascii
Executable file
@ -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'
|
||||
|
||||
#------------------------------------------------------------------------------
|
@ -8,6 +8,6 @@
|
||||
#
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
git grep --count -P '\s+$' -- $@
|
||||
git grep --count -P '\s+$' -- "$@"
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
|
Loading…
Reference in New Issue
Block a user