Add perlcritic test and make code comply
[gruntmaster-daemon.git] / lib / Gruntmaster / Daemon / Format.pm
index 5f503a117a534a4749294611034e2315dc8ebe93..a51b6cb66ea6fc6ce3bff0b6a123ca9404e480d9 100644 (file)
@@ -15,7 +15,7 @@ use POSIX qw/mkfifo/;
 use String::ShellQuote qw/shell_quote/;
 use Try::Tiny;
 
 use String::ShellQuote qw/shell_quote/;
 use Try::Tiny;
 
-our $VERSION = "5999.000_004";
+our $VERSION = '5999.000_004';
 our @EXPORT_OK = qw/prepare_files stopvms/;
 
 ##################################################
 our @EXPORT_OK = qw/prepare_files stopvms/;
 
 ##################################################
@@ -47,11 +47,11 @@ sub execlist {
                get_logger->trace("Running in VM $vm: $cmd");
                $vm{$vm}->send($cmd);
        } else {
                get_logger->trace("Running in VM $vm: $cmd");
                $vm{$vm}->send($cmd);
        } else {
-               my $ret = fork // die 'Cannot fork';
+               my $ret = fork // die "Cannot fork\n";
                if ($ret) {
                        waitpid $ret, 0;
                } else {
                if ($ret) {
                        waitpid $ret, 0;
                } else {
-                       open STDOUT, ">$er";
+                       open STDOUT, '>', $er or die "Cannot open $er\n";
                        exec 'gruntmaster-exec', @args;
                }
        }
                        exec 'gruntmaster-exec', @args;
                }
        }
@@ -59,9 +59,9 @@ sub execlist {
        die "gruntmaster-exec died\n" if -z $er;
        my ($excode, $exmsg) = read_file $er;
        unlink $er;
        die "gruntmaster-exec died\n" if -z $er;
        my ($excode, $exmsg) = read_file $er;
        unlink $er;
-       chomp ($excode, $exmsg);
+       chomp ($excode, $exmsg); ## no critic (ProhibitParensWithBuiltins)
        get_logger->trace("Exec result: $excode $exmsg");
        get_logger->trace("Exec result: $excode $exmsg");
-       die [$excode, $exmsg] if $excode > 0;
+       die [$excode, $exmsg] if $excode > 0; ## no critic (RequireCarping)
 }
 
 sub command_and_args{
 }
 
 sub command_and_args{
@@ -83,7 +83,7 @@ sub mkrun{
                local *__ANON__ = 'mkrun_runner';
                my ($name, %args) = @_;
                get_logger->trace("Running $name...");
                local *__ANON__ = 'mkrun_runner';
                my ($name, %args) = @_;
                get_logger->trace("Running $name...");
-               my $basename = fileparse $name, qr/\.[^.]*/;
+               my $basename = fileparse $name, qr/[.][^.]*/s;
                my @args;
                push @args, '--timeout', $args{timeout} if $args{timeout};
                push @args, '--mlimit',  $args{mlimit}  if $args{mlimit};
                my @args;
                push @args, '--timeout', $args{timeout} if $args{timeout};
                push @args, '--mlimit',  $args{mlimit}  if $args{mlimit};
This page took 0.010248 seconds and 4 git commands to generate.