Skip to content

Commit

Permalink
auto format shell scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
Paul Dreik authored and pauldreik committed Feb 3, 2025
1 parent 8fed68d commit 3752a77
Show file tree
Hide file tree
Showing 21 changed files with 697 additions and 744 deletions.
8 changes: 4 additions & 4 deletions bootstrap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ set -e
me="$(basename "$0")"

for prog in aclocal autoheader automake autoconf make; do
if ! which $prog >/dev/null 2>&1 ; then
echo "$me: please install $prog"
exit 1
fi
if ! which $prog >/dev/null 2>&1; then
echo "$me: please install $prog"
exit 1
fi
done

aclocal --warnings=all
Expand Down
7 changes: 2 additions & 5 deletions cppcheck/run_cppcheck.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,10 @@ cppcheck $args --xml ./*.cc ./*.hh 2>"$outdir/cppcheck.xml"

cppcheck-htmlreport --source-dir=. --title=rdfind --file="$outdir/cppcheck.xml" --report-dir="$outdir"


#is anything serious found?
if grep --quiet -v -E '^(style|information|performance):' "$outdir/cppcheck.out"; then
echo "$me: cppcheck found serious issues. see $outdir/cppcheck.out"
exit 1
echo "$me: cppcheck found serious issues. see $outdir/cppcheck.out"
exit 1
fi

echo "$me: cppcheck passed without serious issues."


14 changes: 7 additions & 7 deletions do_clang_format.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@
# See LICENSE for further details.

#find clang format (usually named clang-format-3.x or clang-format, who knows)
CLANGFORMAT="$(find /usr/local/bin /usr/bin -executable -name "clang-format*" |grep -v -- -diff |sort -g |tail -n1)"
CLANGFORMAT="$(find /usr/local/bin /usr/bin -executable -name "clang-format*" | grep -v -- -diff | sort -g | tail -n1)"

if [ ! -x "$CLANGFORMAT" ] ; then
echo "failed finding clangformat"
exit 1
if [ ! -x "$CLANGFORMAT" ]; then
echo "failed finding clangformat"
exit 1
else
echo "found clang format: $CLANGFORMAT"
echo "found clang format: $CLANGFORMAT"
fi

find . -maxdepth 1 -type f \( -name "*.h" -o -name "*.cpp" -o -name "*.cc" -o -name "*.hh" \) -print0 | \
xargs -0 -n1 "$CLANGFORMAT" -i
find . -maxdepth 1 -type f \( -name "*.h" -o -name "*.cpp" -o -name "*.cc" -o -name "*.hh" \) -print0 \
| xargs -0 -n1 "$CLANGFORMAT" -i
Loading

0 comments on commit 3752a77

Please sign in to comment.