Skip to content

Commit

Permalink
Include ConsistentQuoteLikeWords policy
Browse files Browse the repository at this point in the history
  • Loading branch information
jknphy committed Nov 27, 2018
1 parent 9e91790 commit 6b5d997
Show file tree
Hide file tree
Showing 9 changed files with 23 additions and 22 deletions.
3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,8 @@ endif

PERLCRITIC=PERL5LIB=tools/lib/perlcritic:$$PERL5LIB perlcritic --quiet \
--exclude Perl::Critic::Policy::BuiltinFunctions::ProhibitStringyEval \
--include Perl::Critic::Policy::HashKeyQuote
--include Perl::Critic::Policy::HashKeyQuote \
--include Perl::Critic::Policy::ConsistentQuoteLikeWords

.PHONY: perlcritic
perlcritic: tools/lib/
Expand Down
2 changes: 1 addition & 1 deletion lib/ipmi_backend_utils.pm
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ use Exporter;
use strict;
use warnings;
use testapi;
use version_utils qw/is_storage_ng is_sle/;
use version_utils qw(is_storage_ng is_sle);
use utils;
use power_action_utils 'prepare_system_shutdown';

Expand Down
2 changes: 1 addition & 1 deletion lib/kdump_utils.pm
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ use Exporter;
use strict;
use testapi;
use utils;
use List::Util qw(maxstr);
use List::Util 'maxstr';
use version_utils qw(is_sle is_jeos);

our @EXPORT = qw(install_kernel_debuginfo prepare_for_kdump activate_kdump kdump_is_active do_kdump);
Expand Down
2 changes: 1 addition & 1 deletion lib/main_ltp.pm
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ use Exporter;
use testapi qw(check_var get_var);
use autotest;
use utils;
use LTP::TestInfo qw(testinfo);
use LTP::TestInfo 'testinfo';
use File::Basename 'basename';
use main_common qw(load_bootloader_s390x boot_hdd_image get_ltp_tag);
use 5.018;
Expand Down
4 changes: 2 additions & 2 deletions lib/migration.pm
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ use strict;
use testapi;
use utils;
use registration;
use qam qw/remove_test_repositories/;
use version_utils qw(is_sle is_sles4sap);
use qam 'remove_test_repositories';
use version_utils qw(sle_version_at_least is_sle is_sles4sap);

our @EXPORT = qw(
setup_sle
Expand Down
2 changes: 1 addition & 1 deletion lib/repo_tools.pm
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ use testapi;
use utils;
use version_utils qw(is_sle is_leap is_tumbleweed);

our @EXPORT = qw (smt_wizard smt_mirror_repo rmt_wizard rmt_mirror_repo prepare_source_repo disable_source_repo get_repo_var_name prepare_oss_repo disable_oss_repo);
our @EXPORT = qw(smt_wizard smt_mirror_repo rmt_wizard rmt_mirror_repo prepare_source_repo disable_source_repo get_repo_var_name prepare_oss_repo disable_oss_repo);

=head2 get_repo_var_name
This takes something like "MODULE_BASESYSTEM_SOURCE" as parameter
Expand Down
2 changes: 1 addition & 1 deletion lib/selenium.pm
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ use version_utils 'is_sle';

use Selenium::Remote::Driver;
use Selenium::Chrome;
use Selenium::Waiter qw/wait_until/;
use Selenium::Waiter 'wait_until';
use Selenium::Remote::WDKeys;

my $port = 4444;
Expand Down
2 changes: 1 addition & 1 deletion lib/suseconnect_register.pm
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ use utils;
use registration;


our @EXPORT = qw (suseconnect_registration command_register is_module assert_module);
our @EXPORT = qw(suseconnect_registration command_register is_module assert_module);

sub suseconnect_registration {
my $product_version = get_required_var('VERSION');
Expand Down
26 changes: 13 additions & 13 deletions t/01_version_utils.t
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,19 @@ use testapi qw(check_var get_var set_var);

subtest 'check_version' => sub {
# compare versions if possible
ok version_utils::check_version($_, '15.5'), "check $_, 15.5" for qw[ >15.0 <15.10 ];
ok !version_utils::check_version($_, '15.5'), "check $_, 15.5" for qw[ =15.50 >=15.10 ];
ok version_utils::check_version($_, '15.5'), "check $_, 15.5" for qw(>15.0 <15.10);
ok !version_utils::check_version($_, '15.5'), "check $_, 15.5" for qw(=15.50 >=15.10);

# compare strings if not
ok version_utils::check_version($_, 'klm'), "check $_, klm" for qw[ abc+ 1+ =KLM ];
ok version_utils::check_version($_, 'klm'), "check $_, klm" for qw(abc+ 1+ =KLM);

# die if regex does not match
for (qw[ 1.3+ 11-sp1+ ]) {
for (qw(1.3+ 11-sp1+)) {
dies_ok { version_utils::check_version($_, '12-sp3', qr/^\d{2}/) } "check $_, 12-sp3, ^\\d{2}";
}

# die if compare symbols are wrong
for (qw[ =1.3+ >1.3+ <>1.3 > 12 abc ]) {
for (qw(=1.3+ >1.3+ <>1.3 > 12 abc)) {
dies_ok { version_utils::check_version($_, '12-sp3') } "check $_, 12-sp3";
}
};
Expand All @@ -52,12 +52,12 @@ subtest 'is_leap' => sub {

set_var('VERSION', '42.3');
ok is_leap, "check is_leap";
ok is_leap($_), "check $_" for qw[ =42.3 <=15.0 >42.1 >=42.3 ];
ok !is_leap($_), "check $_" for qw[ =15.0 >42.3 <42.3 <13.0 ];
dies_ok { is_leap $_ } "check $_" for (qw[ 13+ <=15 =42 42+ 42.1:S:A+ =42.3:S:A ]);
ok is_leap($_), "check $_" for qw(=42.3 <=15.0 >42.1 >=42.3);
ok !is_leap($_), "check $_" for qw(=15.0 >42.3 <42.3 <13.0);
dies_ok { is_leap $_ } "check $_" for (qw(13+ <=15 =42 42+ 42.1:S:A+ =42.3:S:A));

set_var('VERSION', '42.3:S:A');
ok is_leap($_), "check $_" for qw[ =42.3 <=15.0 ];
ok is_leap($_), "check $_" for qw(=42.3 <=15.0);
};

subtest 'is_sle' => sub {
Expand All @@ -71,12 +71,12 @@ subtest 'is_sle' => sub {

set_var('VERSION', '12');
ok is_sle, "check is_sle";
ok is_sle($_), "check $_" for qw[ =12 >=12 <=12 12+ <12-sp1 <=15-sp2 <15 11+ >11 >=11 11-sp1+ ];
ok !is_sle($_), "check $_" for qw[ >12 <12 >12-sp1 15-sp1+ >=15 <=11 <11-sp2 ];
dies_ok { is_sle $_ } "check $_" for (qw[ 12 15- =12+ >1 1-sp1+ <15+ 15-sp1 ]);
ok is_sle($_), "check $_" for qw(=12 >=12 <=12 12+ <12-sp1 <=15-sp2 <15 11+ >11 >=11 11-sp1+);
ok !is_sle($_), "check $_" for qw(>12 <12 >12-sp1 15-sp1+ >=15 <=11 <11-sp2);
dies_ok { is_sle $_ } "check $_" for (qw(12 15- =12+ >1 1-sp1+ <15+ 15-sp1));

set_var('VERSION', '12-SP2');
ok is_sle($_), "check $_" for qw[ =12-sp2 =12-sP2 <=15 >11-sp3 <12-sp3 >12-sp1 <12-SP3 >12-SP1];
ok is_sle($_), "check $_" for qw(=12-sp2 =12-sP2 <=15 >11-sp3 <12-sp3 >12-sp1 <12-SP3 >12-SP1);
};

done_testing;

0 comments on commit 6b5d997

Please sign in to comment.