Change indent format for minimal changes with latest

Latest indent 2.2.12 has some changes and bug fixes including adding -sar to -kr
and recognizing size_t as a standard type.

Change-Id: Id613cfb3cebdbe8e9e8823236adb5ee6eb712229
Signed-off-by: Greg Tucker <greg.b.tucker@intel.com>
This commit is contained in:
Greg Tucker 2019-07-03 14:56:32 -07:00
parent 0111c21cbc
commit 430e862a9c
2 changed files with 5 additions and 4 deletions

View File

@ -3,7 +3,8 @@
set -e
rc=0
verbose=0
indent_args='-npro -kr -i8 -ts8 -sob -l95 -ss -ncs -cp1 -lps'
indent_args='-linux -l95 -cp1 -lps -il6 -ncs'
function iver { printf "%03d%03d%03d%03d" $(echo "$@" | sed 's/GNU indent//' | tr '.' ' '); }
while [ -n "$*" ]; do
case "$1" in
@ -24,7 +25,7 @@ if ! git rev-parse --is-inside-work-tree >& /dev/null; then
exit 1
fi
if hash indent && indent --version | grep -q GNU; then
if hash indent && [ $(iver $(indent --version)) -ge $(iver 2.2.12) ]; then
echo "Checking C files for coding style..."
for f in `git ls-files '*.c'`; do
[ "$verbose" -gt 0 ] && echo "checking style on $f"
@ -36,7 +37,7 @@ if hash indent && indent --version | grep -q GNU; then
done
[ "$rc" -gt 0 ] && echo " Run ./tools/iindent on files"
else
echo "You do not have indent installed so your code style is not being checked!"
echo "You do not have a recent indent installed so your code style is not being checked!"
fi
if hash grep; then

View File

@ -1,2 +1,2 @@
#!/bin/sh
indent -npro -kr -i8 -ts8 -sob -l95 -ss -ncs -cp1 -lps "$@"
indent -linux -l95 -cp1 -lps -il6 -ncs "$@"