Skip to content

Commit

Permalink
Adressing commments from codereview
Browse files Browse the repository at this point in the history
  • Loading branch information
josegomezr committed Nov 13, 2023
1 parent 36b4039 commit 6417c43
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 20 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
.perltidyrc
*.tdy
.*.swp
*~
Expand Down
2 changes: 0 additions & 2 deletions lib/OpenQA/Test/PatchDeparse.pm
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
package OpenQA::Test::PatchDeparse;
use strict;
use warnings 'all';
use Test::Most;

# Monkeypatch B::Deparse
Expand Down
2 changes: 0 additions & 2 deletions lib/OpenQA/Test/TimeLimit.pm
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
# SPDX-License-Identifier: GPL-2.0-or-later

package OpenQA::Test::TimeLimit;
use strict;
use warnings 'all';
use Test::Most;

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

Check warning on line 7 in lib/OpenQA/Test/TimeLimit.pm

View workflow job for this annotation

GitHub Actions / Perlcritic

Code before strictures are enabled - severity 5

[TestingAndDebugging::RequireUseStrict] See page 429 of PBP

Check warning on line 7 in lib/OpenQA/Test/TimeLimit.pm

View workflow job for this annotation

GitHub Actions / Perlcritic

Code before strictures are enabled - severity 5

[TestingAndDebugging::RequireUseStrict] See page 429 of PBP
Expand Down
14 changes: 4 additions & 10 deletions tools/perlcritic
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,16 @@
#
# perlcritic with auto-injection of custom perlcritic rules.
use strict;
use warnings 'all';
use Cwd qw(abs_path getcwd);
use File::Basename 'dirname';
use File::Spec::Functions 'catfile';
use warnings;
use FindBin '$Bin';

sub extra_include_paths {
my @extra_paths = @_;
# using abs_path without arguments so symlinks are not resolved.
# dirname twice to go from `$prj_root/tools/tidyall` to: `$proj_root`
my $prj_root = dirname dirname catfile(abs_path(), __FILE__);

my @paths = ();

foreach my $path (@extra_paths) {
push @paths, catfile($prj_root, $path);
push @paths, catfile($prj_root, "external/os-autoinst-common", $path);
push @paths, "$Bin/../$path";
push @paths, "$Bin/../external/os-autoinst-common/$path";
}

# Remove non existing paths
Expand Down
6 changes: 3 additions & 3 deletions tools/tidyall
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,16 @@ Grabs the perltidy version from cpanfile using Module::CPANfile.
=cut

sub perltidy_version {
$_ = Module::CPANfile->load('cpanfile')
my $version = Module::CPANfile->load('cpanfile')
->prereq_for_module('Perl::Tidy')
->requirement
->version;
# Version requirements may contain qualifiers >=, ==, <, etc. The convention
# is to separate the qualifier from the actual version with a space.
#
# It's safe enough to assume that the last item is really the version.
@_ = split(' ', $_);
return pop();
my @version_components = split(' ', $version);
return pop(@version_components);
}

sub is_force_flag { $_ eq '--force' }
Expand Down
4 changes: 2 additions & 2 deletions tools/update-deps
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
# SPDX-License-Identifier: GPL-2.0-or-later

use strict;
use warnings 'all';
use 5.26;
use warnings;
use 5.010;

use YAML::PP;
use Data::Dumper;
Expand Down

0 comments on commit 6417c43

Please sign in to comment.