timescaledb/scripts/perltidy_format_all.sh
Jan Nidzwetzki f172679022 Added perltidy make target
This patch introduces the make target 'perltidy' to format Perl files
with perltidy. In addition, calling perltidy is added to 'make format'.
2023-06-26 10:59:19 +02:00

17 lines
489 B
Bash
Executable File

#!/bin/bash
SCRIPTDIR=$(cd "$(dirname $0)" || exit; pwd)
BASEDIR=$(dirname $SCRIPTDIR)
PERLTIDY=${PERLTIDY:-perltidy}
PERLTIDY_CONFIG=${PERLTIDY_CONFIG:-$BASEDIR/.perltidyrc}
if [ ! -f "$PERLTIDY_CONFIG" ]; then
echo "perltidy config '$PERLTIDY_CONFIG' not found"
exit 1
fi
find "$BASEDIR"/test -name '*.p[lm]' -exec "$PERLTIDY" --profile="$PERLTIDY_CONFIG" -b -bext=/ {} +
find "$BASEDIR"/tsl/test -name '*.p[lm]' -exec "$PERLTIDY" --profile="$PERLTIDY_CONFIG" -b -bext=/ {} +