Skip to content

Commit

Permalink
Enable check for "use strict" and "use warnings"
Browse files Browse the repository at this point in the history
Perlcritic, as part of our CI, now checks that 'use strict' and 'use
warnings' are present in every module. This commit also includes adding
those lines to all modules that don't have them yet.
  • Loading branch information
agraul authored and okurz committed Feb 25, 2019
1 parent 586699b commit 0b2af21
Show file tree
Hide file tree
Showing 930 changed files with 932 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ else
test: unit-test test-static test-compile perlcritic
endif

PERLCRITIC=PERL5LIB=tools/lib/perlcritic:$$PERL5LIB perlcritic --quiet --gentle
PERLCRITIC=PERL5LIB=tools/lib/perlcritic:$$PERL5LIB perlcritic --quiet --gentle --include "strict"

.PHONY: perlcritic
perlcritic: tools/lib/
Expand Down
1 change: 1 addition & 0 deletions lib/apachetest.pm
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ use base Exporter;
use Exporter;

use strict;
use warnings;

use testapi;
use utils;
Expand Down
1 change: 1 addition & 0 deletions lib/apparmortest.pm
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
package apparmortest;

use strict;
use warnings;
use testapi;
use utils;
use version_utils qw(is_sle is_leap);
Expand Down
1 change: 1 addition & 0 deletions lib/bootloader_setup.pm
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ use base Exporter;
use Exporter;

use strict;
use warnings;

use File::Basename 'basename';
use Time::HiRes 'sleep';
Expand Down
1 change: 1 addition & 0 deletions lib/btrfs_test.pm
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package btrfs_test;
use base 'consoletest';

use strict;
use warnings;
use testapi;
use utils 'get_root_console_tty';

Expand Down
1 change: 1 addition & 0 deletions lib/caasp_controller.pm
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package caasp_controller;
use base "opensusebasetest";

use strict;
use warnings;
use testapi;
use caasp qw(unpause script_assert0);
use lockapi qw(barrier_try_wait barrier_destroy);
Expand Down
1 change: 1 addition & 0 deletions lib/console_yasttest.pm
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
package console_yasttest;
use base 'y2logsstep';
use strict;
use warnings;
use testapi;
use utils 'show_tasks_in_blocked_state';

Expand Down
1 change: 1 addition & 0 deletions lib/consoletest.pm
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package consoletest;
use base "opensusebasetest";

use strict;
use warnings;
use testapi;

# Base class for all console tests
Expand Down
1 change: 1 addition & 0 deletions lib/data_integrity_utils.pm
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ package data_integrity_utils;
use base Exporter;
use Exporter;
use strict;
use warnings;
use testapi;
use File::Basename;
use Digest::file 'digest_file_hex';
Expand Down
1 change: 1 addition & 0 deletions lib/hpcbase.pm
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package hpcbase;
use base "opensusebasetest";
use strict;
use warnings;
use testapi;
use utils 'systemctl';

Expand Down
1 change: 1 addition & 0 deletions lib/installbasetest.pm
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package installbasetest;
use base "opensusebasetest";
use strict;
use warnings;

# All steps in the installation are 'fatal'.

Expand Down
1 change: 1 addition & 0 deletions lib/installsummarystep.pm
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package installsummarystep;
use base "y2logsstep";
use testapi;
use strict;
use warnings;


sub accept3rdparty {
Expand Down
1 change: 1 addition & 0 deletions lib/kdump_utils.pm
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ package kdump_utils;
use base Exporter;
use Exporter;
use strict;
use warnings;
use testapi;
use utils;
use List::Util 'maxstr';
Expand Down
3 changes: 2 additions & 1 deletion lib/kernel.pm
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# SUSE's openQA tests
#
# Copyright © 2018 SUSE LLC
# Copyright © 2018-2019 SUSE LLC
#
# Copying and distribution of this file, with or without modification,
# are permitted in any medium without royalty provided the copyright
Expand All @@ -10,6 +10,7 @@ use 5.018;
use testapi;
use utils;
use version_utils 'is_sle';
use warnings;

our @EXPORT_OK = qw(
remove_kernel_packages
Expand Down
1 change: 1 addition & 0 deletions lib/known_bugs.pm
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
use base Exporter;
use Exporter;
use strict;
use warnings;
use testapi;
use main_common;
use version_utils;
Expand Down
1 change: 1 addition & 0 deletions lib/linuxrc.pm
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package linuxrc;
use base "opensusebasetest";
use testapi;
use strict;
use warnings;

#
# Shared functionality for handling Linuxrc
Expand Down
1 change: 1 addition & 0 deletions lib/mailtest.pm
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ package mailtest;
use base Exporter;
use Exporter;
use strict;
use warnings;
use testapi;
use utils;
use version_utils 'is_tumbleweed';
Expand Down
1 change: 1 addition & 0 deletions lib/main_ltp.pm
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ use LTP::TestInfo 'testinfo';
use File::Basename 'basename';
use main_common qw(load_bootloader_s390x boot_hdd_image get_ltp_tag);
use 5.018;
use warnings;

our @EXPORT = 'load_kernel_tests';

Expand Down
1 change: 1 addition & 0 deletions lib/migration.pm
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ use base Exporter;
use Exporter;

use strict;
use warnings;

use testapi;
use utils;
Expand Down
1 change: 1 addition & 0 deletions lib/mm_network.pm
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package mm_network;

use strict;
use warnings;

use base 'Exporter';
use Exporter;
Expand Down
1 change: 1 addition & 0 deletions lib/mm_tests.pm
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ use base Exporter;
use Exporter;

use strict;
use warnings;

use testapi;
use utils;
Expand Down
1 change: 1 addition & 0 deletions lib/network_utils.pm
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ use base Exporter;
use Exporter;

use strict;
use warnings;
use testapi;

our @EXPORT = qw(setup_static_network recover_network can_upload_logs iface ifc_exists);
Expand Down
1 change: 1 addition & 0 deletions lib/networkdbase.pm
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
package networkdbase;

use strict;
use warnings;
use testapi;
use utils;

Expand Down
1 change: 1 addition & 0 deletions lib/openscaptest.pm
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ use Exporter;

use consoletest;
use strict;
use warnings;
use testapi;
use utils;

Expand Down
1 change: 1 addition & 0 deletions lib/opensusebasetest.pm
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ use base 'basetest';
use bootloader_setup qw(stop_grub_timeout boot_local_disk tianocore_enter_menu zkvm_add_disk zkvm_add_pty zkvm_add_interface type_hyperv_fb_video_resolution);
use testapi;
use strict;
use warnings;
use utils;
use lockapi 'mutex_wait';
use serial_terminal 'get_login_message';
Expand Down
1 change: 1 addition & 0 deletions lib/partition_setup.pm
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ package partition_setup;
use base Exporter;
use Exporter;
use strict;
use warnings;
use testapi;
use version_utils ':VERSION';
use installation_user_settings 'await_password_check';
Expand Down
1 change: 1 addition & 0 deletions lib/proxymode.pm
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ package proxymode;
use base 'y2logsstep';
use testapi;
use strict;
use warnings;

our $SLAVE_SERIALDEV = 'proxyserial';

Expand Down
1 change: 1 addition & 0 deletions lib/publiccloud/basetest.pm
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ use publiccloud::azure;
use publiccloud::ec2;
use publiccloud::gce;
use strict;
use warnings;

sub provider_factory {
my ($self) = @_;
Expand Down
1 change: 1 addition & 0 deletions lib/publiccloud/gce.pm
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ use Mojo::Util 'b64_decode';
use Mojo::JSON 'decode_json';
use testapi;
use strict;
use warnings;
use utils;

use constant CREDENTIALS_FILE => '/root/google_credentials.json';
Expand Down
1 change: 1 addition & 0 deletions lib/qam.pm
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
package qam;

use strict;
use warnings;

use base "Exporter";
use Exporter;
Expand Down
1 change: 1 addition & 0 deletions lib/registration.pm
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ use base Exporter;
use Exporter;

use strict;
use warnings;

use testapi;
use utils qw(addon_decline_license assert_screen_with_soft_timeout zypper_call systemctl handle_untrusted_gpg_key);
Expand Down
1 change: 1 addition & 0 deletions lib/rescuecdstep.pm
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package rescuecdstep;
use base "opensusebasetest";
use testapi;
use strict;
use warnings;

# Base class for all RESCUECD tests

Expand Down
1 change: 1 addition & 0 deletions lib/selenium.pm
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

package selenium;
use 5.018;
use warnings;

use base 'Exporter';
use Exporter;
Expand Down
1 change: 1 addition & 0 deletions lib/sles4sap.pm
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package sles4sap;
use base "opensusebasetest";

use strict;
use warnings;
use testapi;
use utils;
use isotovideo;
Expand Down
1 change: 1 addition & 0 deletions lib/suseconnect_register.pm
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ use base Exporter;
use Exporter;

use strict;
use warnings;
use testapi;
use utils;
use registration;
Expand Down
1 change: 1 addition & 0 deletions lib/susedistribution.pm
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package susedistribution;
use base 'distribution';
use serial_terminal ();
use strict;
use warnings;
use utils qw(
disable_serial_getty
ensure_serialdev_permissions
Expand Down
1 change: 1 addition & 0 deletions lib/upload_system_log.pm
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ package upload_system_log;
# Maintainer: Yong Sun <[email protected]>

use strict;
use warnings;
use base "Exporter";
use Exporter;
use testapi;
Expand Down
1 change: 1 addition & 0 deletions lib/utils.pm
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ use base Exporter;
use Exporter;

use strict;
use warnings;
use testapi qw(is_serial_terminal :DEFAULT);
use lockapi 'mutex_wait';
use mm_network;
Expand Down
1 change: 1 addition & 0 deletions lib/version_utils.pm
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ package version_utils;
use base Exporter;
use Exporter;
use strict;
use warnings;
use testapi qw(check_var get_var set_var);
use version 'is_lax';

Expand Down
1 change: 1 addition & 0 deletions lib/virtmanager.pm
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package virtmanager;
use testapi;
use strict;
use warnings;

our @ISA = qw(Exporter);
our @EXPORT = qw(launch_virtmanager connection_details create_vnet create_new_pool
Expand Down
1 change: 1 addition & 0 deletions lib/wickedbase.pm
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ use testapi qw(is_serial_terminal :DEFAULT);
use serial_terminal;
use Carp;
use strict;
use warnings;

=head2 wicked_command
Expand Down
1 change: 1 addition & 0 deletions lib/windows_utils.pm
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ use base Exporter;
use Exporter;

use strict;
use warnings;

use testapi;

Expand Down
1 change: 1 addition & 0 deletions lib/xen.pm
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ package xen;

use base 'consoletest';
use strict;
use warnings;
use testapi;
use utils;

Expand Down
1 change: 1 addition & 0 deletions lib/xml_utils.pm
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
# Summary: Library for parsing xml files
# Maintainer: Rodion Iafarov <[email protected]>
use strict;
use warnings;
use XML::LibXML;
use Exporter 'import';

Expand Down
1 change: 1 addition & 0 deletions lib/y2_common.pm
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ use base Exporter;
use Exporter;

use strict;
use warnings;
use testapi;
use version_utils qw(is_opensuse is_leap);

Expand Down
1 change: 1 addition & 0 deletions lib/y2lan_restart_common.pm
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
package y2lan_restart_common;

use strict;
use warnings;
use Exporter 'import';
use testapi;
use utils 'systemctl';
Expand Down
1 change: 1 addition & 0 deletions lib/y2logsstep.pm
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package y2logsstep;
use base "installbasetest";
use testapi;
use strict;
use warnings;
use version_utils qw(is_sle is_caasp);
use ipmi_backend_utils;
use network_utils;
Expand Down
1 change: 1 addition & 0 deletions lib/y2snapper_common.pm
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package y2snapper_common;

use strict;
use warnings;
use testapi;
use utils;
use version_utils;
Expand Down
Loading

0 comments on commit 0b2af21

Please sign in to comment.