1
0
mirror of https://github.com/postgres/postgres.git synced 2025-09-03 15:22:11 +03:00

Add a script to detect perl compile time errors and warnings

Also add a function that centralizes the logic for locating all our perl
files and use it in pgperlcritic and pgperltidy as well as the new
pgperlcheck.
This commit is contained in:
Andrew Dunstan
2018-06-11 14:47:20 -04:00
parent be3d90026a
commit af616ce483
4 changed files with 37 additions and 22 deletions

View File

@@ -7,14 +7,6 @@ set -e
# set this to override default perltidy program:
PERLTIDY=${PERLTIDY:-perltidy}
# locate all Perl files in the tree
(
# take all .pl and .pm files
find . -type f -a \( -name '*.pl' -o -name '*.pm' \)
# take executable files that file(1) thinks are perl files
find . -type f -perm -100 -exec file {} \; |
egrep -i ':.*perl[0-9]*\>' |
cut -d: -f1
) |
sort -u |
xargs $PERLTIDY --profile=src/tools/pgindent/perltidyrc
. src/tools/perlcheck/find_perl_files
find_perl_files | xargs $PERLTIDY --profile=src/tools/pgindent/perltidyrc