Skip to content

Commit

Permalink
Run -Mstrict -Mdiagnostics to check Perl files (#602)
Browse files Browse the repository at this point in the history
---------

Co-authored-by: Mark Roberts <[email protected]>
  • Loading branch information
mernst and markro49 authored Sep 9, 2024
1 parent 3577670 commit 85e4cbc
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
1 change: 1 addition & 0 deletions cpanfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@ requires 'DBI', '>= 1.63';
requires 'JSON', '>= 2.97';
requires 'JSON::Parse', '>= 0.55';
requires 'List::Util', '>= 1.33';
requires 'Perl::Critic';
requires 'String::Interpolate', '>= 0.33';
requires 'URI', '>= 1.72';
11 changes: 11 additions & 0 deletions framework/test/test_style.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,17 @@ TOPLEVEL="$(git rev-parse --show-toplevel)"

cd "$TOPLEVEL" || (echo "Cannot cd to $TOPLEVEL" && exit 1)

# Check style of Perl scripts
find . \( -name '*.pm' -o -name '*.pl' \) -print0 | xargs -0 -n1 perl -Mstrict -Mdiagnostics -cw
grep -l --exclude-dir=project_repos --exclude=\*.pm --exclude=\*.pl --exclude=\*.sh --exclude=template -r "=pod" . | while IFS= read -r file ; do
perl -Mstrict -Mdiagnostics -cw "$file"
done
# Don't run perlcritic yet.
## Over time, reduce the severity number, eventually to 1.
# perlcritic --severity 5 "$TOPLEVEL"/framework
# Don't run perltidy yet.
# find . \( -name '*.pm' -o -name '*.pl' \) -print0 | xargs -0 perltidy -b

# Check style of sh scripts.
grep -r -l '^\#! \?\(/bin/\|/usr/bin/env \)sh' --exclude=\*~ "$TOPLEVEL"/framework | while read -r line
do
Expand Down

0 comments on commit 85e4cbc

Please sign in to comment.