Add Perl code check GitHub action

Add a run of `perltidy` to make sure that all the Perl code is
correctly formatted. Also fix the formatting of one file that did not
follow the style in `scripts/perltidyrc`.
This commit is contained in:
Mats Kindahl 2021-05-21 11:36:41 +02:00 committed by Mats Kindahl
parent 80b915d001
commit 551ac56937
2 changed files with 15 additions and 2 deletions

View File

@ -8,6 +8,18 @@ on:
- prerelease_test
pull_request:
jobs:
perl_checks:
name: Check Perl code in tree
runs-on: ubuntu-20.04
steps:
- name: Install prerequisites
run: sudo apt install perltidy
- name: Checkout source
uses: actions/checkout@v2
- name: Format Perl files, if needed
run: find . -name '*.p[lm]' -exec perltidy --profile=scripts/perltidyrc {} +
- name: Check for diff
run: git diff --exit-code
misc_checks:
name: Check formatting, license and git hooks
runs-on: ubuntu-20.04

View File

@ -32,7 +32,7 @@ sub get_new_ts_node
{
my ($name, $class) = @_;
$class //= 'TimescaleNode';
$class //= 'TimescaleNode';
my $self = PostgresNode::get_new_node($name);
$self = bless $self, $class;
@ -48,7 +48,8 @@ sub init
$self->SUPER::init(%kwargs);
# append into postgresql.conf from Timescale
# template config file
$self->append_conf('postgresql.conf', TestLib::slurp_file("$ENV{'BUILDIR'}/tsl/test/postgresql.conf"));
$self->append_conf('postgresql.conf',
TestLib::slurp_file("$ENV{'BUILDIR'}/tsl/test/postgresql.conf"));
}
# helper function to check output from PSQL for a query