mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: bin/tools/git-find-non-ascii: find non-ASCII chars in source code
This commit is contained in:
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+$' -- "$@"
|
||||||
|
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
|
|||||||
Reference in New Issue
Block a user