Skip to content

Commit

Permalink
Add signatures to all new code
Browse files Browse the repository at this point in the history
  • Loading branch information
josegomezr committed Nov 13, 2023
1 parent 0d23938 commit 2015886
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 9 deletions.
3 changes: 1 addition & 2 deletions lib/OpenQA/Test/TimeLimit.pm
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@ use Test::Most;

my $SCALE_FACTOR = $ENV{OPENQA_TEST_TIMEOUT_SCALE_FACTOR} // 1;

sub import {
my ($package, $limit) = @_;
sub import ($package, $limit, @) {
die "$package: Need argument on import, e.g. use: use OpenQA::Test::TimeLimit '42';" unless $limit;
# disable timeout if requested by ENV variable or running within debugger
return if ($ENV{OPENQA_TEST_TIMEOUT_DISABLE} or $INC{'perl5db.pl'});
Expand Down
4 changes: 2 additions & 2 deletions lib/perlcritic/Perl/Critic/Policy/HashKeyQuotes.pm
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ package Perl::Critic::Policy::HashKeyQuotes;

use strict;
use warnings;
use feature 'signatures';
use base 'Perl::Critic::Policy';

use Perl::Critic::Utils qw( :severities :classification :ppi );
Expand All @@ -17,8 +18,7 @@ sub applies_to { return qw(PPI::Token::Quote::Single PPI::Token::Quote::Double)

# check that hashes are not overly using quotes
# (os-autoinst coding style)
sub violates ($elem) {

sub violates ($self, $elem, $document) {
#we only want the check hash keys
return if !is_hash_key($elem);

Expand Down
5 changes: 2 additions & 3 deletions tools/perlcritic
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,10 @@
# perlcritic with auto-injection of custom perlcritic rules.
use strict;
use warnings;
use feature 'signatures';
use FindBin '$Bin';

sub extra_include_paths {
my @extra_paths = @_;

sub extra_include_paths (@extra_paths) {
my @paths = ();
foreach my $path (@extra_paths) {
push @paths, "$Bin/../$path";
Expand Down
4 changes: 2 additions & 2 deletions tools/tidyall
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Grabs the perltidy version from cpanfile using Module::CPANfile.
=cut

sub perltidy_version {
sub perltidy_version() {
my $version = Module::CPANfile->load('cpanfile')
->prereq_for_module('Perl::Tidy')
->requirement
Expand All @@ -26,7 +26,7 @@ sub perltidy_version {
return (split ' ', $version)[-1];
}

sub is_force_flag { $_ eq '--force' }
sub is_force_flag() { $_ eq '--force' }

my $required_version = perltidy_version();
my $detected_version = $Perl::Tidy::VERSION;
Expand Down

0 comments on commit 2015886

Please sign in to comment.