Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit91703ca

Browse files
committed
Add a script and a config file to run perlcritic
This is similar to what we do to run perltidy. For now we only run atseverity level 5. Over time we can improve our perl code and reduce theseverity level.Discussion:https://postgr.es/m/86aa2a3a-0c68-21fb-9560-84ad6914d561@2ndQuadrant.com
1 parentcb5d942 commit91703ca

File tree

2 files changed

+42
-0
lines changed

2 files changed

+42
-0
lines changed

‎src/tools/pgperlcritic/perlcriticrc

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
######################################################################
2+
#
3+
# src/tools/pgperlcritic/perlcriticrc
4+
#
5+
# config file for perlcritic for Postgres project
6+
#
7+
#####################################################################
8+
9+
severity = 5
10+
11+
theme = core
12+
13+
# allow octal constants with leading zeros
14+
[-ValuesAndExpressions::ProhibitLeadingZeros]

‎src/tools/pgperlcritic/pgperlcritic

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
#!/bin/sh
2+
3+
# src/tools/pgperlcritic/pgperlcritic
4+
5+
test -f src/tools/pgperlcritic/perlcriticrc|| {
6+
echo could not find src/tools/pgperlcritic/perlcriticrc
7+
exit 1
8+
}
9+
10+
set -e
11+
12+
# set this to override default perlcritic program:
13+
PERLCRITIC=${PERLCRITIC:-perlcritic}
14+
15+
# locate all Perl files in the tree
16+
{
17+
# take all .pl and .pm files
18+
find. -type f -a\( -name'*.pl' -o -name'*.pm'\) -print
19+
# take executable files that file(1) thinks are perl files
20+
find. -type f -perm -100 -exec file {}\; -print|
21+
egrep -i':.*perl[0-9]*\>'|
22+
cut -d: -f1
23+
}|
24+
sort -u|
25+
xargs$PERLCRITIC \
26+
--quiet \
27+
--program-extensions .pl \
28+
--profile=src/tools/pgperlcritic/perlcriticrc

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp