diff --git a/cpanfile b/cpanfile index b74515c9c..58342d082 100644 --- a/cpanfile +++ b/cpanfile @@ -18,3 +18,4 @@ requires "File::Copy::Recursive"; requires "Moo", ">= 2.0"; test_requires "Test::MockModule"; +test_requires "Test::Strict"; diff --git a/share/shutter/resources/modules/Shutter/App/AboutDialog.pm b/share/shutter/resources/modules/Shutter/App/AboutDialog.pm index 13e6f5ec5..06344c824 100644 --- a/share/shutter/resources/modules/Shutter/App/AboutDialog.pm +++ b/share/shutter/resources/modules/Shutter/App/AboutDialog.pm @@ -26,6 +26,7 @@ package Shutter::App::AboutDialog; #-------------------------------------- use utf8; use strict; +use warnings; use Gtk3; #Glib diff --git a/share/shutter/resources/modules/Shutter/App/GlobalSettings.pm b/share/shutter/resources/modules/Shutter/App/GlobalSettings.pm index d1f83e4ca..2affb9a74 100644 --- a/share/shutter/resources/modules/Shutter/App/GlobalSettings.pm +++ b/share/shutter/resources/modules/Shutter/App/GlobalSettings.pm @@ -26,6 +26,7 @@ package Shutter::App::GlobalSettings; #-------------------------------------- use utf8; use strict; +use warnings; #Glib use Glib qw/TRUE FALSE/; diff --git a/share/shutter/resources/modules/Shutter/App/HelperFunctions.pm b/share/shutter/resources/modules/Shutter/App/HelperFunctions.pm index ad07a3fcb..6724aa595 100644 --- a/share/shutter/resources/modules/Shutter/App/HelperFunctions.pm +++ b/share/shutter/resources/modules/Shutter/App/HelperFunctions.pm @@ -26,6 +26,7 @@ package Shutter::App::HelperFunctions; #-------------------------------------- use utf8; use strict; +use warnings; use Gtk3; #Glib diff --git a/share/shutter/resources/modules/Shutter/App/Menu.pm b/share/shutter/resources/modules/Shutter/App/Menu.pm index d02a125b5..a5355eafa 100644 --- a/share/shutter/resources/modules/Shutter/App/Menu.pm +++ b/share/shutter/resources/modules/Shutter/App/Menu.pm @@ -26,6 +26,7 @@ package Shutter::App::Menu; #-------------------------------------- use utf8; use strict; +use warnings; use Gtk3; #Glib diff --git a/share/shutter/resources/modules/Shutter/App/Optional/Exif.pm b/share/shutter/resources/modules/Shutter/App/Optional/Exif.pm index 169e11d6e..d6d21e43c 100644 --- a/share/shutter/resources/modules/Shutter/App/Optional/Exif.pm +++ b/share/shutter/resources/modules/Shutter/App/Optional/Exif.pm @@ -26,6 +26,7 @@ package Shutter::App::Optional::Exif; #-------------------------------------- use utf8; use strict; +use warnings; use Glib qw/TRUE FALSE/; diff --git a/share/shutter/resources/modules/Shutter/App/Toolbar.pm b/share/shutter/resources/modules/Shutter/App/Toolbar.pm index 680551aea..2f8c2a478 100644 --- a/share/shutter/resources/modules/Shutter/App/Toolbar.pm +++ b/share/shutter/resources/modules/Shutter/App/Toolbar.pm @@ -26,6 +26,7 @@ package Shutter::App::Toolbar; #-------------------------------------- use utf8; use strict; +use warnings; use Gtk3; #Glib diff --git a/share/shutter/resources/modules/Shutter/Upload/FTP.pm b/share/shutter/resources/modules/Shutter/Upload/FTP.pm index 3c41eec72..df0084ca0 100644 --- a/share/shutter/resources/modules/Shutter/Upload/FTP.pm +++ b/share/shutter/resources/modules/Shutter/Upload/FTP.pm @@ -24,6 +24,7 @@ package Shutter::Upload::FTP; use utf8; use strict; +use warnings; use Net::FTP; use URI; use URI::Split qw(uri_split); diff --git a/share/shutter/resources/modules/Shutter/Upload/Shared.pm b/share/shutter/resources/modules/Shutter/Upload/Shared.pm index da6b4572d..48c8442c0 100644 --- a/share/shutter/resources/modules/Shutter/Upload/Shared.pm +++ b/share/shutter/resources/modules/Shutter/Upload/Shared.pm @@ -25,6 +25,7 @@ package Shutter::Upload::Shared; use utf8; use strict; +use warnings; use POSIX qw/setlocale/; use Locale::gettext; use Glib qw/TRUE FALSE/; diff --git a/share/shutter/resources/modules/X11/Protocol/Ext/XFIXES.pm b/share/shutter/resources/modules/X11/Protocol/Ext/XFIXES.pm index 50dea39cd..46a8ab848 100644 --- a/share/shutter/resources/modules/X11/Protocol/Ext/XFIXES.pm +++ b/share/shutter/resources/modules/X11/Protocol/Ext/XFIXES.pm @@ -20,6 +20,7 @@ BEGIN { require 5 } package X11::Protocol::Ext::XFIXES; use X11::Protocol 'padded'; use strict; +use warnings; use Carp; use vars '$VERSION', '@CARP_NOT'; diff --git a/t/syntax.t b/t/syntax.t new file mode 100644 index 000000000..71857ac88 --- /dev/null +++ b/t/syntax.t @@ -0,0 +1,19 @@ +#!/usr/bin/perl + +use strict; +use warnings; + +use Test::More; +use Test::Strict; + +use FindBin qw/$Bin/; + +# Check syntax, use strict and use warnings on all perl files + +local $Test::Strict::TEST_WARNINGS = 1; + +my @dirs = ('t', 'bin', "$Bin/../share/shutter/resources/modules/"); + +all_perl_files_ok(@dirs); + +done_testing;