1
0
mirror of https://github.com/postgres/postgres.git synced 2025-05-26 18:17:33 +03:00
postgres/src/tools/perlcheck/pgperlcritic
Peter Eisentraut 3d9fd1a874 Allow and require passing files on command line of pgperltidy
pgperltidy as well as pgperlcritic and pgperlsyncheck now allow
passing files and directories on the command line, like pgindent does.
(Previously, they would always operate on the whole tree.)

Also, for consistency with pgindent's new behavior (as of b16259b3c1),
passing an argument is now required.  To get the previous default
behavior, use "pgperltidy ." for example.

Discussion: https://www.postgresql.org/message-id/flat/45aacd8a-5265-d9da-8df2-b8e2c0cf6a07%40eisentraut.org
2023-06-21 16:20:26 +02:00

21 lines
427 B
Bash
Executable File

#!/bin/sh
# src/tools/perlcheck/pgperlcritic
test -f src/tools/perlcheck/perlcriticrc || {
echo could not find src/tools/perlcheck/perlcriticrc
exit 1
}
set -e
# set this to override default perlcritic program:
PERLCRITIC=${PERLCRITIC:-perlcritic}
. src/tools/perlcheck/find_perl_files
find_perl_files "$@" | xargs $PERLCRITIC \
--quiet \
--program-extensions .pl \
--profile=src/tools/perlcheck/perlcriticrc