Skip to content

Commit 681b9ff

Browse files
committed
Run pgperltidy in github actions
Just as we use pgindent to validate that our c files conform to postgres coding standards, we also run pgperltidy to do the same for perl files. We only run it on our own code in contrib/pg_tde/ This doesn't actually run pgperltidy as we need to inject some options in a way that didn't seem possible in that script. Instead it does the same thing with some slight changes. We also bump the ubuntu version for this google actions job to the newest LTS as the older ubuntu version seems to have a version of perltidy that doesn't support the options used by pgperltidy.
1 parent 71da1f0 commit 681b9ff

File tree

3 files changed

+15
-2
lines changed

3 files changed

+15
-2
lines changed

.github/workflows/pgindent.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ defaults:
1010
jobs:
1111
check:
1212
name: Check
13-
runs-on: ubuntu-22.04
13+
runs-on: ubuntu-24.04
1414
steps:
1515
- name: Clone repository
1616
uses: actions/checkout@v4
@@ -26,6 +26,9 @@ jobs:
2626

2727
- name: Update typedefs
2828
run: ci_scripts/dump-typedefs.sh
29-
29+
3030
- name: Run pgindent
3131
run: ci_scripts/run-pgindent.sh --check --diff
32+
33+
- name: Run pgperltidy
34+
run: ci_scripts/run-pgperltidy.sh --assert-tidy --standard-error-output

ci_scripts/run-pgperltidy.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#!/bin/bash
2+
3+
SCRIPT_DIR="$(cd -- "$(dirname "$0")" >/dev/null 2>&1; pwd -P)"
4+
cd "$SCRIPT_DIR/../"
5+
6+
source src/tools/perlcheck/find_perl_files
7+
8+
find_perl_files contrib/pg_tde/ | xargs perltidy "$@" --profile=src/tools/pgindent/perltidyrc

ci_scripts/ubuntu-deps.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@ DEPS=(
4343
python3-pykmip
4444
libhttp-server-simple-perl
4545
lcov
46+
# Run pgperltidy
47+
perltidy
4648
)
4749

4850
sudo apt-get update

0 commit comments

Comments
 (0)