Skip to content

Commit

Permalink
Add Perl code check GitHub action
Browse files Browse the repository at this point in the history
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`.
  • Loading branch information
mkindahl committed May 21, 2021
1 parent 80b915d commit 551ac56
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
12 changes: 12 additions & 0 deletions .github/workflows/code_style.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 3 additions & 2 deletions test/perl/TimescaleNode.pm
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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
Expand Down

0 comments on commit 551ac56

Please sign in to comment.