From: Peter Rabbitson Date: Wed, 13 Feb 2013 22:20:29 +0000 (+0100) Subject: Add strict/warnings test, adjust all offenders (wow, that was a lot) X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=4a233f3019d2baa4bf2abee0c873c74d5cdf3a11;p=dbsrgits%2FDBIx-Class-Historic.git Add strict/warnings test, adjust all offenders (wow, that was a lot) Should shut kwalitee up: http://cpants.cpanauthors.org/dist/DBIx-Class --- diff --git a/Changes b/Changes index e134e9e..6eacbb1 100644 --- a/Changes +++ b/Changes @@ -8,6 +8,7 @@ Revision history for DBIx::Class * Misc - Fixup our distbuilding process to stop creating world-writable tarball contents (implicitly fixes RT#83084) + - Added strict and warnings tests for all lib and test files 0.08206 2013-02-08 * Fixes diff --git a/examples/Schema/MyDatabase/Main.pm b/examples/Schema/MyDatabase/Main.pm index 42fae1b..6217cac 100644 --- a/examples/Schema/MyDatabase/Main.pm +++ b/examples/Schema/MyDatabase/Main.pm @@ -1,4 +1,8 @@ package MyDatabase::Main; + +use warnings; +use strict; + use base qw/DBIx::Class::Schema/; __PACKAGE__->load_namespaces; diff --git a/lib/DBIx/Class/Admin/Descriptive.pm b/lib/DBIx/Class/Admin/Descriptive.pm index 9326fca..c3a1e1a 100644 --- a/lib/DBIx/Class/Admin/Descriptive.pm +++ b/lib/DBIx/Class/Admin/Descriptive.pm @@ -1,6 +1,8 @@ package # hide from PAUSE DBIx::Class::Admin::Descriptive; +use warnings; +use strict; use base 'Getopt::Long::Descriptive'; diff --git a/lib/DBIx/Class/Admin/Usage.pm b/lib/DBIx/Class/Admin/Usage.pm index 2e02705..6aabfd9 100644 --- a/lib/DBIx/Class/Admin/Usage.pm +++ b/lib/DBIx/Class/Admin/Usage.pm @@ -1,6 +1,8 @@ package # hide from PAUSE DBIx::Class::Admin::Usage; +use warnings; +use strict; use base 'Getopt::Long::Descriptive::Usage'; diff --git a/lib/DBIx/Class/Optional/Dependencies.pm b/lib/DBIx/Class/Optional/Dependencies.pm index a21e99b..a96c189 100644 --- a/lib/DBIx/Class/Optional/Dependencies.pm +++ b/lib/DBIx/Class/Optional/Dependencies.pm @@ -189,6 +189,12 @@ my $reqs = { }, }, + test_strictures => { + req => { + 'Test::Strict' => '0.16', + }, + }, + test_prettydebug => { req => $json_any, }, diff --git a/lib/DBIx/Class/SQLAHacks.pm b/lib/DBIx/Class/SQLAHacks.pm index ee3f156..98bb571 100644 --- a/lib/DBIx/Class/SQLAHacks.pm +++ b/lib/DBIx/Class/SQLAHacks.pm @@ -1,6 +1,9 @@ package # Hide from PAUSE DBIx::Class::SQLAHacks; +use warnings; +use strict; + use base qw/DBIx::Class::SQLMaker/; 1; diff --git a/lib/DBIx/Class/SQLAHacks/MSSQL.pm b/lib/DBIx/Class/SQLAHacks/MSSQL.pm index 6472ac3..8551a9c 100644 --- a/lib/DBIx/Class/SQLAHacks/MSSQL.pm +++ b/lib/DBIx/Class/SQLAHacks/MSSQL.pm @@ -1,6 +1,9 @@ package # Hide from PAUSE DBIx::Class::SQLAHacks::MSSQL; +use warnings; +use strict; + use base qw( DBIx::Class::SQLMaker::MSSQL ); 1; diff --git a/lib/DBIx/Class/SQLAHacks/MySQL.pm b/lib/DBIx/Class/SQLAHacks/MySQL.pm index 7b6f09a..d58e420 100644 --- a/lib/DBIx/Class/SQLAHacks/MySQL.pm +++ b/lib/DBIx/Class/SQLAHacks/MySQL.pm @@ -1,6 +1,9 @@ package # Hide from PAUSE DBIx::Class::SQLAHacks::MySQL; +use warnings; +use strict; + use base qw( DBIx::Class::SQLMaker::MySQL ); 1; diff --git a/lib/DBIx/Class/SQLAHacks/Oracle.pm b/lib/DBIx/Class/SQLAHacks/Oracle.pm index d5447c3..a55936d 100644 --- a/lib/DBIx/Class/SQLAHacks/Oracle.pm +++ b/lib/DBIx/Class/SQLAHacks/Oracle.pm @@ -1,6 +1,9 @@ package # Hide from PAUSE DBIx::Class::SQLAHacks::Oracle; +use warnings; +use strict; + use base qw( DBIx::Class::SQLMaker::Oracle ); 1; diff --git a/lib/DBIx/Class/SQLAHacks/OracleJoins.pm b/lib/DBIx/Class/SQLAHacks/OracleJoins.pm index 120df49..8e88fc1 100644 --- a/lib/DBIx/Class/SQLAHacks/OracleJoins.pm +++ b/lib/DBIx/Class/SQLAHacks/OracleJoins.pm @@ -1,6 +1,9 @@ package # Hide from PAUSE DBIx::Class::SQLAHacks::OracleJoins; +use warnings; +use strict; + use base qw( DBIx::Class::SQLMaker::OracleJoins ); 1; diff --git a/lib/DBIx/Class/SQLAHacks/SQLite.pm b/lib/DBIx/Class/SQLAHacks/SQLite.pm index 937cbf6..c9e4ad7 100644 --- a/lib/DBIx/Class/SQLAHacks/SQLite.pm +++ b/lib/DBIx/Class/SQLAHacks/SQLite.pm @@ -1,6 +1,9 @@ package # Hide from PAUSE DBIx::Class::SQLAHacks::SQLite; +use warnings; +use strict; + use base qw( DBIx::Class::SQLMaker::SQLite ); 1; diff --git a/lib/DBIx/Class/SQLMaker/MSSQL.pm b/lib/DBIx/Class/SQLMaker/MSSQL.pm index f64d972..39e2c4f 100644 --- a/lib/DBIx/Class/SQLMaker/MSSQL.pm +++ b/lib/DBIx/Class/SQLMaker/MSSQL.pm @@ -1,6 +1,9 @@ package # Hide from PAUSE DBIx::Class::SQLMaker::MSSQL; +use warnings; +use strict; + use base qw( DBIx::Class::SQLMaker ); # diff --git a/lib/DBIx/Class/SQLMaker/SQLite.pm b/lib/DBIx/Class/SQLMaker/SQLite.pm index acf0337..91f78e4 100644 --- a/lib/DBIx/Class/SQLMaker/SQLite.pm +++ b/lib/DBIx/Class/SQLMaker/SQLite.pm @@ -1,6 +1,9 @@ package # Hide from PAUSE DBIx::Class::SQLMaker::SQLite; +use warnings; +use strict; + use base qw( DBIx::Class::SQLMaker ); # diff --git a/lib/DBIx/Class/StartupCheck.pm b/lib/DBIx/Class/StartupCheck.pm index 86230d6..10b554a 100644 --- a/lib/DBIx/Class/StartupCheck.pm +++ b/lib/DBIx/Class/StartupCheck.pm @@ -1,5 +1,8 @@ package DBIx::Class::StartupCheck; +use strict; +use warnings; + =head1 NAME DBIx::Class::StartupCheck - Run environment checks on startup diff --git a/lib/DBIx/Class/Storage/DBI/ADO.pm b/lib/DBIx/Class/Storage/DBI/ADO.pm index 469564d..0e5c286 100644 --- a/lib/DBIx/Class/Storage/DBI/ADO.pm +++ b/lib/DBIx/Class/Storage/DBI/ADO.pm @@ -1,5 +1,8 @@ package DBIx::Class::Storage::DBI::ADO; +use warnings; +use strict; + use base 'DBIx::Class::Storage::DBI'; use mro 'c3'; diff --git a/lib/DBIx/Class/Storage/DBI/Sybase/ASE/NoBindVars.pm b/lib/DBIx/Class/Storage/DBI/Sybase/ASE/NoBindVars.pm index 8eeee49..b5ade31 100644 --- a/lib/DBIx/Class/Storage/DBI/Sybase/ASE/NoBindVars.pm +++ b/lib/DBIx/Class/Storage/DBI/Sybase/ASE/NoBindVars.pm @@ -1,5 +1,8 @@ package DBIx::Class::Storage::DBI::Sybase::ASE::NoBindVars; +use warnings; +use strict; + use base qw/ DBIx::Class::Storage::DBI::NoBindVars DBIx::Class::Storage::DBI::Sybase::ASE diff --git a/t/26dumper.t b/t/26dumper.t index a238085..ade5031 100644 --- a/t/26dumper.t +++ b/t/26dumper.t @@ -1,4 +1,5 @@ use strict; +use warnings; use Test::More; use Data::Dumper; diff --git a/t/cdbi/01-columns.t b/t/cdbi/01-columns.t index 88b8189..275ed4a 100644 --- a/t/cdbi/01-columns.t +++ b/t/cdbi/01-columns.t @@ -1,4 +1,5 @@ use strict; +use warnings; use Test::More; use lib 't/cdbi/testlib'; diff --git a/t/cdbi/02-Film.t b/t/cdbi/02-Film.t index 0885f69..fe4a691 100644 --- a/t/cdbi/02-Film.t +++ b/t/cdbi/02-Film.t @@ -1,4 +1,6 @@ use strict; +use warnings; + use Test::More; use Scalar::Util 'refaddr'; use namespace::clean; diff --git a/t/cdbi/03-subclassing.t b/t/cdbi/03-subclassing.t index 9bc77e8..767b341 100644 --- a/t/cdbi/03-subclassing.t +++ b/t/cdbi/03-subclassing.t @@ -1,4 +1,6 @@ use strict; +use warnings; + use Test::More; #---------------------------------------------------------------------- diff --git a/t/cdbi/06-hasa.t b/t/cdbi/06-hasa.t index ef49c14..255383b 100644 --- a/t/cdbi/06-hasa.t +++ b/t/cdbi/06-hasa.t @@ -1,4 +1,5 @@ use strict; +use warnings; use Test::More; @YA::Film::ISA = 'Film'; diff --git a/t/cdbi/08-inheritcols.t b/t/cdbi/08-inheritcols.t index 93b1bd8..5550e59 100644 --- a/t/cdbi/08-inheritcols.t +++ b/t/cdbi/08-inheritcols.t @@ -1,4 +1,5 @@ use strict; +use warnings; use Test::More; use lib 't/cdbi/testlib'; diff --git a/t/cdbi/09-has_many.t b/t/cdbi/09-has_many.t index c2939ef..89a59a5 100644 --- a/t/cdbi/09-has_many.t +++ b/t/cdbi/09-has_many.t @@ -1,4 +1,5 @@ use strict; +use warnings; use Test::More; use lib 't/cdbi/testlib'; diff --git a/t/cdbi/11-triggers.t b/t/cdbi/11-triggers.t index 40ba0bd..c944248 100644 --- a/t/cdbi/11-triggers.t +++ b/t/cdbi/11-triggers.t @@ -1,4 +1,5 @@ use strict; +use warnings; use Test::More; use lib 't/cdbi/testlib'; diff --git a/t/cdbi/12-filter.t b/t/cdbi/12-filter.t index 928bc70..9a715ed 100644 --- a/t/cdbi/12-filter.t +++ b/t/cdbi/12-filter.t @@ -1,4 +1,5 @@ use strict; +use warnings; use Test::More; use lib 't/cdbi/testlib'; diff --git a/t/cdbi/13-constraint.t b/t/cdbi/13-constraint.t index 3254196..4191fe5 100644 --- a/t/cdbi/13-constraint.t +++ b/t/cdbi/13-constraint.t @@ -1,4 +1,5 @@ use strict; +use warnings; use Test::More; use lib 't/cdbi/testlib'; diff --git a/t/cdbi/14-might_have.t b/t/cdbi/14-might_have.t index d79a746..73318ac 100644 --- a/t/cdbi/14-might_have.t +++ b/t/cdbi/14-might_have.t @@ -1,4 +1,5 @@ use strict; +use warnings; use Test::More; use lib 't/cdbi/testlib'; diff --git a/t/cdbi/15-accessor.t b/t/cdbi/15-accessor.t index 3dfbf41..267916d 100644 --- a/t/cdbi/15-accessor.t +++ b/t/cdbi/15-accessor.t @@ -1,4 +1,5 @@ use strict; +use warnings; use Test::More; INIT { diff --git a/t/cdbi/16-reserved.t b/t/cdbi/16-reserved.t index 380c819..e54d0ae 100644 --- a/t/cdbi/16-reserved.t +++ b/t/cdbi/16-reserved.t @@ -1,4 +1,5 @@ use strict; +use warnings; use Test::More; use lib 't/cdbi/testlib'; diff --git a/t/cdbi/18-has_a.t b/t/cdbi/18-has_a.t index 5a8ee2a..1dacd6c 100644 --- a/t/cdbi/18-has_a.t +++ b/t/cdbi/18-has_a.t @@ -1,4 +1,5 @@ use strict; +use warnings; use Test::More; use lib 't/cdbi/testlib'; diff --git a/t/cdbi/19-set_sql.t b/t/cdbi/19-set_sql.t index 85242ed..41040af 100644 --- a/t/cdbi/19-set_sql.t +++ b/t/cdbi/19-set_sql.t @@ -1,4 +1,5 @@ use strict; +use warnings; use Test::More; use lib 't/cdbi/testlib'; diff --git a/t/cdbi/21-iterator.t b/t/cdbi/21-iterator.t index d4f397e..f49bf68 100644 --- a/t/cdbi/21-iterator.t +++ b/t/cdbi/21-iterator.t @@ -1,4 +1,5 @@ use strict; +use warnings; use Test::More; use lib 't/cdbi/testlib'; diff --git a/t/cdbi/22-deflate_order.t b/t/cdbi/22-deflate_order.t index a318850..d4e9935 100644 --- a/t/cdbi/22-deflate_order.t +++ b/t/cdbi/22-deflate_order.t @@ -1,4 +1,5 @@ $| = 1; +use warnings; use strict; use Test::More; diff --git a/t/cdbi/22-self_referential.t b/t/cdbi/22-self_referential.t index 6a99acd..1538ef4 100644 --- a/t/cdbi/22-self_referential.t +++ b/t/cdbi/22-self_referential.t @@ -1,6 +1,6 @@ -use Test::More; - use strict; +use warnings; +use Test::More; use lib 't/cdbi/testlib'; use Actor; diff --git a/t/cdbi/23-cascade.t b/t/cdbi/23-cascade.t index fdee3f7..eb9c3f5 100644 --- a/t/cdbi/23-cascade.t +++ b/t/cdbi/23-cascade.t @@ -1,4 +1,5 @@ use strict; +use warnings; use Test::More; use Data::Dumper; diff --git a/t/cdbi/24-meta_info.t b/t/cdbi/24-meta_info.t index 0a44fb5..f2fc57f 100644 --- a/t/cdbi/24-meta_info.t +++ b/t/cdbi/24-meta_info.t @@ -1,4 +1,5 @@ use strict; +use warnings; use Test::More; use Test::Warn; diff --git a/t/cdbi/26-mutator.t b/t/cdbi/26-mutator.t index ad4d645..a203059 100644 --- a/t/cdbi/26-mutator.t +++ b/t/cdbi/26-mutator.t @@ -1,4 +1,5 @@ use strict; +use warnings; use Test::More; use lib 't/cdbi/testlib'; diff --git a/t/cdbi/30-pager.t b/t/cdbi/30-pager.t index cb1cee9..9ee838a 100644 --- a/t/cdbi/30-pager.t +++ b/t/cdbi/30-pager.t @@ -1,4 +1,5 @@ use strict; +use warnings; use Test::More; use lib 't/cdbi/testlib'; diff --git a/t/cdbi/98-failure.t b/t/cdbi/98-failure.t index 73db8ad..1a42e03 100644 --- a/t/cdbi/98-failure.t +++ b/t/cdbi/98-failure.t @@ -1,4 +1,5 @@ use strict; +use warnings; use Test::More; #---------------------------------------------------------------------- diff --git a/t/cdbi/DeepAbstractSearch/01_search.t b/t/cdbi/DeepAbstractSearch/01_search.t index 10f5f99..95ad021 100644 --- a/t/cdbi/DeepAbstractSearch/01_search.t +++ b/t/cdbi/DeepAbstractSearch/01_search.t @@ -1,4 +1,5 @@ use strict; +use warnings; use Test::More; use lib 't/cdbi/testlib'; diff --git a/t/cdbi/columns_as_hashes.t b/t/cdbi/columns_as_hashes.t index fcb6b17..f10f522 100644 --- a/t/cdbi/columns_as_hashes.t +++ b/t/cdbi/columns_as_hashes.t @@ -1,4 +1,5 @@ use strict; +use warnings; use Test::More; use Test::Warn; diff --git a/t/cdbi/columns_dont_override_custom_accessors.t b/t/cdbi/columns_dont_override_custom_accessors.t index fdff082..27a96fd 100644 --- a/t/cdbi/columns_dont_override_custom_accessors.t +++ b/t/cdbi/columns_dont_override_custom_accessors.t @@ -1,4 +1,5 @@ use strict; +use warnings; use Test::More; use lib 't/cdbi/testlib'; diff --git a/t/cdbi/construct.t b/t/cdbi/construct.t index 1e15a34..1ce8160 100644 --- a/t/cdbi/construct.t +++ b/t/cdbi/construct.t @@ -1,4 +1,5 @@ use strict; +use warnings; use Test::More; INIT { diff --git a/t/cdbi/copy.t b/t/cdbi/copy.t index bde83ec..6c079cc 100644 --- a/t/cdbi/copy.t +++ b/t/cdbi/copy.t @@ -1,4 +1,5 @@ use strict; +use warnings; use Test::More; INIT { diff --git a/t/cdbi/early_column_heisenbug.t b/t/cdbi/early_column_heisenbug.t index 0dd87b9..859d43d 100644 --- a/t/cdbi/early_column_heisenbug.t +++ b/t/cdbi/early_column_heisenbug.t @@ -1,4 +1,5 @@ use strict; +use warnings; use Test::More; diff --git a/t/cdbi/has_many_loads_foreign_class.t b/t/cdbi/has_many_loads_foreign_class.t index 4275f65..bba66e8 100644 --- a/t/cdbi/has_many_loads_foreign_class.t +++ b/t/cdbi/has_many_loads_foreign_class.t @@ -1,4 +1,5 @@ use strict; +use warnings; use Test::More; use Class::Inspector (); diff --git a/t/cdbi/hasa_without_loading.t b/t/cdbi/hasa_without_loading.t index 8173fdb..5f92df2 100644 --- a/t/cdbi/hasa_without_loading.t +++ b/t/cdbi/hasa_without_loading.t @@ -1,4 +1,5 @@ use strict; +use warnings; use Test::More; use lib 't/cdbi/testlib'; diff --git a/t/cdbi/max_min_value_of.t b/t/cdbi/max_min_value_of.t index e9e627e..5dc2f1a 100644 --- a/t/cdbi/max_min_value_of.t +++ b/t/cdbi/max_min_value_of.t @@ -1,4 +1,5 @@ use strict; +use warnings; use Test::More; #---------------------------------------------------------------------- diff --git a/t/cdbi/mk_group_accessors.t b/t/cdbi/mk_group_accessors.t index fa82c01..08adeef 100644 --- a/t/cdbi/mk_group_accessors.t +++ b/t/cdbi/mk_group_accessors.t @@ -1,4 +1,5 @@ use strict; +use warnings; use Test::More; INIT { diff --git a/t/cdbi/multi_column_set.t b/t/cdbi/multi_column_set.t index bae1d4c..8ca3bcf 100644 --- a/t/cdbi/multi_column_set.t +++ b/t/cdbi/multi_column_set.t @@ -1,4 +1,5 @@ use strict; +use warnings; use Test::More; use lib 't/cdbi/testlib'; diff --git a/t/cdbi/object_cache.t b/t/cdbi/object_cache.t index a0fdd20..c349940 100644 --- a/t/cdbi/object_cache.t +++ b/t/cdbi/object_cache.t @@ -1,4 +1,5 @@ use strict; +use warnings; use Test::More; $| = 1; diff --git a/t/cdbi/retrieve_from_sql_with_limit.t b/t/cdbi/retrieve_from_sql_with_limit.t index 64dfe03..a73358c 100644 --- a/t/cdbi/retrieve_from_sql_with_limit.t +++ b/t/cdbi/retrieve_from_sql_with_limit.t @@ -1,4 +1,5 @@ use strict; +use warnings; use Test::More; INIT { diff --git a/t/cdbi/set_to_undef.t b/t/cdbi/set_to_undef.t index 20fe77b..03fe0ca 100644 --- a/t/cdbi/set_to_undef.t +++ b/t/cdbi/set_to_undef.t @@ -1,4 +1,5 @@ use strict; +use warnings; use Test::More; use lib 't/cdbi/testlib'; diff --git a/t/cdbi/set_vs_DateTime.t b/t/cdbi/set_vs_DateTime.t index 72d69af..08fe4c9 100644 --- a/t/cdbi/set_vs_DateTime.t +++ b/t/cdbi/set_vs_DateTime.t @@ -1,4 +1,5 @@ use strict; +use warnings; use Test::More; use Test::Exception; diff --git a/t/cdbi/testlib/Blurb.pm b/t/cdbi/testlib/Blurb.pm index 22eb2eb..ba48059 100644 --- a/t/cdbi/testlib/Blurb.pm +++ b/t/cdbi/testlib/Blurb.pm @@ -1,7 +1,9 @@ package # hide from PAUSE Blurb; +use warnings; use strict; + use base 'DBIC::Test::SQLite'; __PACKAGE__->set_table('Blurbs'); diff --git a/t/cdbi/testlib/CDBase.pm b/t/cdbi/testlib/CDBase.pm index 282b74d..75447a2 100644 --- a/t/cdbi/testlib/CDBase.pm +++ b/t/cdbi/testlib/CDBase.pm @@ -1,7 +1,9 @@ package # hide from PAUSE CDBase; +use warnings; use strict; + use base qw(DBIC::Test::SQLite); 1; diff --git a/t/cdbi/testlib/Director.pm b/t/cdbi/testlib/Director.pm index 511c0e7..5bed696 100644 --- a/t/cdbi/testlib/Director.pm +++ b/t/cdbi/testlib/Director.pm @@ -1,7 +1,9 @@ package # hide from PAUSE Director; +use warnings; use strict; + use base 'DBIC::Test::SQLite'; __PACKAGE__->set_table('Directors'); diff --git a/t/cdbi/testlib/Film.pm b/t/cdbi/testlib/Film.pm index 9ea829d..3bbd755 100644 --- a/t/cdbi/testlib/Film.pm +++ b/t/cdbi/testlib/Film.pm @@ -1,9 +1,11 @@ package # hide from PAUSE Film; -use base 'DBIC::Test::SQLite'; +use warnings; use strict; +use base 'DBIC::Test::SQLite'; + __PACKAGE__->set_table('Movies'); __PACKAGE__->columns('Primary', 'Title'); __PACKAGE__->columns('Essential', qw( Title )); diff --git a/t/cdbi/testlib/Lazy.pm b/t/cdbi/testlib/Lazy.pm index d05e817..e7770b8 100644 --- a/t/cdbi/testlib/Lazy.pm +++ b/t/cdbi/testlib/Lazy.pm @@ -1,9 +1,11 @@ package # hide from PAUSE Lazy; -use base 'DBIC::Test::SQLite'; +use warnings; use strict; +use base 'DBIC::Test::SQLite'; + __PACKAGE__->set_table("Lazy"); __PACKAGE__->columns('Primary', qw(this)); __PACKAGE__->columns('Essential', qw(opop)); diff --git a/t/cdbi/testlib/Log.pm b/t/cdbi/testlib/Log.pm index 914c60d..4f90ed1 100644 --- a/t/cdbi/testlib/Log.pm +++ b/t/cdbi/testlib/Log.pm @@ -1,9 +1,11 @@ package # hide from PAUSE Log; +use warnings; +use strict; + use base 'MyBase'; -use strict; use Time::Piece::MySQL; use POSIX; diff --git a/t/cdbi/testlib/MyBase.pm b/t/cdbi/testlib/MyBase.pm index c06f179..bf55635 100644 --- a/t/cdbi/testlib/MyBase.pm +++ b/t/cdbi/testlib/MyBase.pm @@ -1,7 +1,9 @@ package # hide from PAUSE MyBase; +use warnings; use strict; + use DBI; use lib 't/lib'; diff --git a/t/cdbi/testlib/MyFilm.pm b/t/cdbi/testlib/MyFilm.pm index 9e9a656..40ecf7e 100644 --- a/t/cdbi/testlib/MyFilm.pm +++ b/t/cdbi/testlib/MyFilm.pm @@ -1,11 +1,12 @@ package # hide from PAUSE MyFilm; +use warnings; +use strict; + use base 'MyBase'; use MyStarLink; -use strict; - __PACKAGE__->set_table(); __PACKAGE__->columns(All => qw/filmid title/); __PACKAGE__->has_many(_stars => 'MyStarLink'); diff --git a/t/cdbi/testlib/MyFoo.pm b/t/cdbi/testlib/MyFoo.pm index 28c3433..11a4feb 100644 --- a/t/cdbi/testlib/MyFoo.pm +++ b/t/cdbi/testlib/MyFoo.pm @@ -1,12 +1,13 @@ package # hide from PAUSE MyFoo; +use warnings; +use strict; + use base 'MyBase'; use Date::Simple 3.03; -use strict; - __PACKAGE__->set_table(); __PACKAGE__->columns(All => qw/myid name val tdate/); __PACKAGE__->has_a( diff --git a/t/cdbi/testlib/MyStar.pm b/t/cdbi/testlib/MyStar.pm index dffae9e..100fbf4 100644 --- a/t/cdbi/testlib/MyStar.pm +++ b/t/cdbi/testlib/MyStar.pm @@ -1,10 +1,11 @@ package # hide from PAUSE MyStar; -use base 'MyBase'; - +use warnings; use strict; +use base 'MyBase'; + __PACKAGE__->set_table(); __PACKAGE__->columns(All => qw/starid name/); __PACKAGE__->has_many(films => [ MyStarLink => 'film' ]); diff --git a/t/cdbi/testlib/MyStarLink.pm b/t/cdbi/testlib/MyStarLink.pm index 1da8733..27254d8 100644 --- a/t/cdbi/testlib/MyStarLink.pm +++ b/t/cdbi/testlib/MyStarLink.pm @@ -1,10 +1,11 @@ package # hide from PAUSE MyStarLink; -use base 'MyBase'; - +use warnings; use strict; +use base 'MyBase'; + __PACKAGE__->set_table(); __PACKAGE__->columns(All => qw/linkid film star/); __PACKAGE__->has_a(film => 'MyFilm'); diff --git a/t/cdbi/testlib/MyStarLinkMCPK.pm b/t/cdbi/testlib/MyStarLinkMCPK.pm index 0b7f55a..1173163 100644 --- a/t/cdbi/testlib/MyStarLinkMCPK.pm +++ b/t/cdbi/testlib/MyStarLinkMCPK.pm @@ -1,13 +1,14 @@ package # hide from PAUSE MyStarLinkMCPK; +use warnings; +use strict; + use base 'MyBase'; use MyStar; use MyFilm; -use strict; - # This is a many-to-many mapping table that uses the two foreign keys # as its own primary key - there's no extra 'auto-inc' column here diff --git a/t/cdbi/testlib/Order.pm b/t/cdbi/testlib/Order.pm index d5281a7..62a16a6 100644 --- a/t/cdbi/testlib/Order.pm +++ b/t/cdbi/testlib/Order.pm @@ -1,7 +1,9 @@ package # hide from PAUSE Order; +use warnings; use strict; + use base 'DBIC::Test::SQLite'; __PACKAGE__->set_table('orders'); diff --git a/t/cdbi/testlib/OtherFilm.pm b/t/cdbi/testlib/OtherFilm.pm index 888e521..a0afdd8 100644 --- a/t/cdbi/testlib/OtherFilm.pm +++ b/t/cdbi/testlib/OtherFilm.pm @@ -1,7 +1,9 @@ package # hide from PAUSE OtherFilm; +use warnings; use strict; + use base 'Film'; __PACKAGE__->set_table('Different_Film'); diff --git a/t/cdbi/testlib/OtherThing.pm b/t/cdbi/testlib/OtherThing.pm index 59fb818..698b342 100644 --- a/t/cdbi/testlib/OtherThing.pm +++ b/t/cdbi/testlib/OtherThing.pm @@ -1,4 +1,8 @@ package OtherThing; + +use warnings; +use strict; + use base 'DBIC::Test::SQLite'; OtherThing->set_table("other_thing"); diff --git a/t/cdbi/testlib/Thing.pm b/t/cdbi/testlib/Thing.pm index 4080b66..7af7aac 100644 --- a/t/cdbi/testlib/Thing.pm +++ b/t/cdbi/testlib/Thing.pm @@ -1,4 +1,8 @@ package Thing; + +use warnings; +use strict; + use base 'DBIC::Test::SQLite'; Thing->set_table("thing"); diff --git a/t/lib/DBICNSTest/Bogus/A.pm b/t/lib/DBICNSTest/Bogus/A.pm index 3d2c9ae..471b39c 100644 --- a/t/lib/DBICNSTest/Bogus/A.pm +++ b/t/lib/DBICNSTest/Bogus/A.pm @@ -1,4 +1,8 @@ package DBICNSTest::Bogus::A; + +use warnings; +use strict; + use base qw/DBIx::Class::Core/; __PACKAGE__->table('a'); __PACKAGE__->add_columns('a'); diff --git a/t/lib/DBICNSTest/Bogus/B.pm b/t/lib/DBICNSTest/Bogus/B.pm index 6cdaaa6..2115a2e 100644 --- a/t/lib/DBICNSTest/Bogus/B.pm +++ b/t/lib/DBICNSTest/Bogus/B.pm @@ -1,4 +1,8 @@ package DBICNSTest::Result::B; + +use warnings; +use strict; + use base qw/DBIx::Class::Core/; __PACKAGE__->table('b'); __PACKAGE__->add_columns('b'); diff --git a/t/lib/DBICNSTest/Bogus/Bigos.pm b/t/lib/DBICNSTest/Bogus/Bigos.pm index 0f49683..37d0e69 100644 --- a/t/lib/DBICNSTest/Bogus/Bigos.pm +++ b/t/lib/DBICNSTest/Bogus/Bigos.pm @@ -1,3 +1,7 @@ package DBICNSTest::Bogus::Bigos; +use warnings; +use strict; + + 1; diff --git a/t/lib/DBICNSTest/OtherRslt/D.pm b/t/lib/DBICNSTest/OtherRslt/D.pm index d74ff11..58058be 100644 --- a/t/lib/DBICNSTest/OtherRslt/D.pm +++ b/t/lib/DBICNSTest/OtherRslt/D.pm @@ -1,4 +1,8 @@ package DBICNSTest::OtherRslt::D; + +use warnings; +use strict; + use base qw/DBIx::Class::Core/; __PACKAGE__->table('d'); __PACKAGE__->add_columns('d'); diff --git a/t/lib/DBICNSTest/RSBase.pm b/t/lib/DBICNSTest/RSBase.pm index 9786d5f..fdac307 100644 --- a/t/lib/DBICNSTest/RSBase.pm +++ b/t/lib/DBICNSTest/RSBase.pm @@ -1,3 +1,7 @@ package DBICNSTest::RSBase; + +use warnings; +use strict; + use base qw/DBIx::Class::ResultSet/; 1; diff --git a/t/lib/DBICNSTest/RSet/A.pm b/t/lib/DBICNSTest/RSet/A.pm index 4cb415f..2c01e02 100644 --- a/t/lib/DBICNSTest/RSet/A.pm +++ b/t/lib/DBICNSTest/RSet/A.pm @@ -1,3 +1,7 @@ package DBICNSTest::RSet::A; + +use warnings; +use strict; + use base qw/DBIx::Class::ResultSet/; 1; diff --git a/t/lib/DBICNSTest/RSet/C.pm b/t/lib/DBICNSTest/RSet/C.pm index c43a3fe..a2590ac 100644 --- a/t/lib/DBICNSTest/RSet/C.pm +++ b/t/lib/DBICNSTest/RSet/C.pm @@ -1,3 +1,7 @@ package DBICNSTest::RSet::C; + +use warnings; +use strict; + use base qw/DBIx::Class::ResultSet/; 1; diff --git a/t/lib/DBICNSTest/Result/A.pm b/t/lib/DBICNSTest/Result/A.pm index 7861989..97f4c77 100644 --- a/t/lib/DBICNSTest/Result/A.pm +++ b/t/lib/DBICNSTest/Result/A.pm @@ -1,4 +1,8 @@ package DBICNSTest::Result::A; + +use warnings; +use strict; + use base qw/DBIx::Class::Core/; __PACKAGE__->table('a'); __PACKAGE__->add_columns('a'); diff --git a/t/lib/DBICNSTest/Result/B.pm b/t/lib/DBICNSTest/Result/B.pm index 6cdaaa6..2115a2e 100644 --- a/t/lib/DBICNSTest/Result/B.pm +++ b/t/lib/DBICNSTest/Result/B.pm @@ -1,4 +1,8 @@ package DBICNSTest::Result::B; + +use warnings; +use strict; + use base qw/DBIx::Class::Core/; __PACKAGE__->table('b'); __PACKAGE__->add_columns('b'); diff --git a/t/lib/DBICNSTest/Result/D.pm b/t/lib/DBICNSTest/Result/D.pm index d7b603f..fd6afbe 100644 --- a/t/lib/DBICNSTest/Result/D.pm +++ b/t/lib/DBICNSTest/Result/D.pm @@ -1,4 +1,8 @@ package DBICNSTest::Result::D; + +use warnings; +use strict; + use base qw/DBIx::Class::Core/; __PACKAGE__->table('d'); __PACKAGE__->add_columns('d'); diff --git a/t/lib/DBICNSTest/ResultSet/A.pm b/t/lib/DBICNSTest/ResultSet/A.pm index c7a86aa..4892ec1 100644 --- a/t/lib/DBICNSTest/ResultSet/A.pm +++ b/t/lib/DBICNSTest/ResultSet/A.pm @@ -1,3 +1,7 @@ package DBICNSTest::ResultSet::A; + +use warnings; +use strict; + use base qw/DBIx::Class::ResultSet/; 1; diff --git a/t/lib/DBICNSTest/ResultSet/C.pm b/t/lib/DBICNSTest/ResultSet/C.pm index 55ecf1d..a7cb951 100644 --- a/t/lib/DBICNSTest/ResultSet/C.pm +++ b/t/lib/DBICNSTest/ResultSet/C.pm @@ -1,3 +1,7 @@ package DBICNSTest::ResultSet::C; + +use warnings; +use strict; + use base qw/DBIx::Class::ResultSet/; 1; diff --git a/t/lib/DBICNSTest/ResultSet/D.pm b/t/lib/DBICNSTest/ResultSet/D.pm index 88894d3..8745100 100644 --- a/t/lib/DBICNSTest/ResultSet/D.pm +++ b/t/lib/DBICNSTest/ResultSet/D.pm @@ -1,2 +1,6 @@ package DBICNSTest::ResultSet::D; + +use warnings; +use strict; + 1; diff --git a/t/lib/DBICNSTest/Rslt/A.pm b/t/lib/DBICNSTest/Rslt/A.pm index d02038f..8d9a6e1 100644 --- a/t/lib/DBICNSTest/Rslt/A.pm +++ b/t/lib/DBICNSTest/Rslt/A.pm @@ -1,4 +1,8 @@ package DBICNSTest::Rslt::A; + +use warnings; +use strict; + use base qw/DBIx::Class::Core/; __PACKAGE__->table('a'); __PACKAGE__->add_columns('a'); diff --git a/t/lib/DBICNSTest/Rslt/B.pm b/t/lib/DBICNSTest/Rslt/B.pm index f7660b9..59b8c75 100644 --- a/t/lib/DBICNSTest/Rslt/B.pm +++ b/t/lib/DBICNSTest/Rslt/B.pm @@ -1,4 +1,8 @@ package DBICNSTest::Rslt::B; + +use warnings; +use strict; + use base qw/DBIx::Class::Core/; __PACKAGE__->table('b'); __PACKAGE__->add_columns('b'); diff --git a/t/lib/DBICTest/ResultSetManager.pm b/t/lib/DBICTest/ResultSetManager.pm index e53804f..7815a8d 100644 --- a/t/lib/DBICTest/ResultSetManager.pm +++ b/t/lib/DBICTest/ResultSetManager.pm @@ -1,5 +1,9 @@ package # hide from PAUSE DBICTest::ResultSetManager; + +use warnings; +use strict; + use base 'DBICTest::BaseSchema'; __PACKAGE__->load_classes("Foo"); diff --git a/t/lib/DBICTest/ResultSetManager/Foo.pm b/t/lib/DBICTest/ResultSetManager/Foo.pm index fec8345..d776491 100644 --- a/t/lib/DBICTest/ResultSetManager/Foo.pm +++ b/t/lib/DBICTest/ResultSetManager/Foo.pm @@ -1,5 +1,9 @@ package # hide from PAUSE DBICTest::ResultSetManager::Foo; + +use warnings; +use strict; + use base 'DBIx::Class::Core'; __PACKAGE__->load_components(qw/ ResultSetManager /); diff --git a/t/lib/DBICTest/Schema/Artist.pm b/t/lib/DBICTest/Schema/Artist.pm index 2e9ff35..20affe0 100644 --- a/t/lib/DBICTest/Schema/Artist.pm +++ b/t/lib/DBICTest/Schema/Artist.pm @@ -1,6 +1,9 @@ package # hide from PAUSE DBICTest::Schema::Artist; +use warnings; +use strict; + use base qw/DBICTest::BaseResult/; use Carp qw/confess/; diff --git a/t/lib/DBICTest/Schema/ArtistGUID.pm b/t/lib/DBICTest/Schema/ArtistGUID.pm index a06a465..243c84b 100644 --- a/t/lib/DBICTest/Schema/ArtistGUID.pm +++ b/t/lib/DBICTest/Schema/ArtistGUID.pm @@ -1,6 +1,9 @@ package # hide from PAUSE DBICTest::Schema::ArtistGUID; +use warnings; +use strict; + use base qw/DBICTest::BaseResult/; # test MSSQL uniqueidentifier type diff --git a/t/lib/DBICTest/Schema/ArtistSourceName.pm b/t/lib/DBICTest/Schema/ArtistSourceName.pm index c59bbe5..3e6a7e6 100644 --- a/t/lib/DBICTest/Schema/ArtistSourceName.pm +++ b/t/lib/DBICTest/Schema/ArtistSourceName.pm @@ -1,6 +1,9 @@ package # hide from PAUSE DBICTest::Schema::ArtistSourceName; +use warnings; +use strict; + use base 'DBICTest::Schema::Artist'; __PACKAGE__->table(__PACKAGE__->table); __PACKAGE__->source_name('SourceNameArtists'); diff --git a/t/lib/DBICTest/Schema/ArtistSubclass.pm b/t/lib/DBICTest/Schema/ArtistSubclass.pm index 8dd3f6f..e1b97fa 100644 --- a/t/lib/DBICTest/Schema/ArtistSubclass.pm +++ b/t/lib/DBICTest/Schema/ArtistSubclass.pm @@ -1,6 +1,9 @@ package # hide from PAUSE DBICTest::Schema::ArtistSubclass; +use warnings; +use strict; + use base 'DBICTest::Schema::Artist'; __PACKAGE__->table(__PACKAGE__->table); diff --git a/t/lib/DBICTest/Schema/ArtistUndirectedMap.pm b/t/lib/DBICTest/Schema/ArtistUndirectedMap.pm index e79faaa..facc1a2 100644 --- a/t/lib/DBICTest/Schema/ArtistUndirectedMap.pm +++ b/t/lib/DBICTest/Schema/ArtistUndirectedMap.pm @@ -1,6 +1,9 @@ package # hide from PAUSE DBICTest::Schema::ArtistUndirectedMap; +use warnings; +use strict; + use base qw/DBICTest::BaseResult/; __PACKAGE__->table('artist_undirected_map'); diff --git a/t/lib/DBICTest/Schema/Artwork.pm b/t/lib/DBICTest/Schema/Artwork.pm index 351d9dd..01ce450 100644 --- a/t/lib/DBICTest/Schema/Artwork.pm +++ b/t/lib/DBICTest/Schema/Artwork.pm @@ -1,6 +1,9 @@ package # hide from PAUSE DBICTest::Schema::Artwork; +use warnings; +use strict; + use base qw/DBICTest::BaseResult/; use Carp qw/confess/; diff --git a/t/lib/DBICTest/Schema/Artwork_to_Artist.pm b/t/lib/DBICTest/Schema/Artwork_to_Artist.pm index dc0d50d..57326e2 100644 --- a/t/lib/DBICTest/Schema/Artwork_to_Artist.pm +++ b/t/lib/DBICTest/Schema/Artwork_to_Artist.pm @@ -1,6 +1,9 @@ package # hide from PAUSE DBICTest::Schema::Artwork_to_Artist; +use warnings; +use strict; + use base qw/DBICTest::BaseResult/; use Carp qw/confess/; diff --git a/t/lib/DBICTest/Schema/BindType.pm b/t/lib/DBICTest/Schema/BindType.pm index e25ad92..97edc8b 100644 --- a/t/lib/DBICTest/Schema/BindType.pm +++ b/t/lib/DBICTest/Schema/BindType.pm @@ -1,6 +1,9 @@ package # hide from PAUSE DBICTest::Schema::BindType; +use warnings; +use strict; + use base qw/DBICTest::BaseResult/; __PACKAGE__->table('bindtype_test'); diff --git a/t/lib/DBICTest/Schema/Bookmark.pm b/t/lib/DBICTest/Schema/Bookmark.pm index 50c18d1..40cfa3f 100644 --- a/t/lib/DBICTest/Schema/Bookmark.pm +++ b/t/lib/DBICTest/Schema/Bookmark.pm @@ -1,11 +1,11 @@ package # hide from PAUSE DBICTest::Schema::Bookmark; -use base qw/DBICTest::BaseResult/; - use strict; use warnings; +use base qw/DBICTest::BaseResult/; + __PACKAGE__->table('bookmark'); __PACKAGE__->add_columns( 'id' => { diff --git a/t/lib/DBICTest/Schema/BooksInLibrary.pm b/t/lib/DBICTest/Schema/BooksInLibrary.pm index 325a460..cd6f375 100644 --- a/t/lib/DBICTest/Schema/BooksInLibrary.pm +++ b/t/lib/DBICTest/Schema/BooksInLibrary.pm @@ -1,6 +1,9 @@ package # hide from PAUSE DBICTest::Schema::BooksInLibrary; +use warnings; +use strict; + use base qw/DBICTest::BaseResult/; __PACKAGE__->table('books'); diff --git a/t/lib/DBICTest/Schema/CD.pm b/t/lib/DBICTest/Schema/CD.pm index 0cbf55a..d10b6be 100644 --- a/t/lib/DBICTest/Schema/CD.pm +++ b/t/lib/DBICTest/Schema/CD.pm @@ -1,6 +1,9 @@ package # hide from PAUSE DBICTest::Schema::CD; +use warnings; +use strict; + use base qw/DBICTest::BaseResult/; # this tests table name as scalar ref diff --git a/t/lib/DBICTest/Schema/CD_to_Producer.pm b/t/lib/DBICTest/Schema/CD_to_Producer.pm index 278396e..b416797 100644 --- a/t/lib/DBICTest/Schema/CD_to_Producer.pm +++ b/t/lib/DBICTest/Schema/CD_to_Producer.pm @@ -1,6 +1,9 @@ package # hide from PAUSE DBICTest::Schema::CD_to_Producer; +use warnings; +use strict; + use base qw/DBICTest::BaseResult/; __PACKAGE__->table('cd_to_producer'); diff --git a/t/lib/DBICTest/Schema/Collection.pm b/t/lib/DBICTest/Schema/Collection.pm index 5943c91..a5f9d86 100644 --- a/t/lib/DBICTest/Schema/Collection.pm +++ b/t/lib/DBICTest/Schema/Collection.pm @@ -1,6 +1,9 @@ package # hide from PAUSE DBICTest::Schema::Collection; +use warnings; +use strict; + use base qw/DBICTest::BaseResult/; __PACKAGE__->table('collection'); diff --git a/t/lib/DBICTest/Schema/CollectionObject.pm b/t/lib/DBICTest/Schema/CollectionObject.pm index a0c8a30..1a013e0 100644 --- a/t/lib/DBICTest/Schema/CollectionObject.pm +++ b/t/lib/DBICTest/Schema/CollectionObject.pm @@ -1,6 +1,9 @@ package # hide from PAUSE DBICTest::Schema::CollectionObject; +use warnings; +use strict; + use base qw/DBICTest::BaseResult/; __PACKAGE__->table('collection_object'); diff --git a/t/lib/DBICTest/Schema/ComputedColumn.pm b/t/lib/DBICTest/Schema/ComputedColumn.pm index d47129c..961b5fc 100644 --- a/t/lib/DBICTest/Schema/ComputedColumn.pm +++ b/t/lib/DBICTest/Schema/ComputedColumn.pm @@ -3,6 +3,9 @@ package # hide from PAUSE # for sybase and mssql computed column tests +use warnings; +use strict; + use base qw/DBICTest::BaseResult/; __PACKAGE__->table('computed_column_test'); diff --git a/t/lib/DBICTest/Schema/CustomSql.pm b/t/lib/DBICTest/Schema/CustomSql.pm index c87e89d..d22b3fe 100644 --- a/t/lib/DBICTest/Schema/CustomSql.pm +++ b/t/lib/DBICTest/Schema/CustomSql.pm @@ -1,6 +1,9 @@ package # hide from PAUSE DBICTest::Schema::CustomSql; +use warnings; +use strict; + use base qw/DBICTest::Schema::Artist/; __PACKAGE__->table('dummy'); diff --git a/t/lib/DBICTest/Schema/Dummy.pm b/t/lib/DBICTest/Schema/Dummy.pm index b4ab736..949a098 100644 --- a/t/lib/DBICTest/Schema/Dummy.pm +++ b/t/lib/DBICTest/Schema/Dummy.pm @@ -1,11 +1,11 @@ package # hide from PAUSE DBICTest::Schema::Dummy; -use base qw/DBICTest::BaseResult/; - use strict; use warnings; +use base qw/DBICTest::BaseResult/; + __PACKAGE__->table('dummy'); __PACKAGE__->add_columns( 'id' => { diff --git a/t/lib/DBICTest/Schema/Employee.pm b/t/lib/DBICTest/Schema/Employee.pm index 59a9467..dde6fd3 100644 --- a/t/lib/DBICTest/Schema/Employee.pm +++ b/t/lib/DBICTest/Schema/Employee.pm @@ -1,6 +1,9 @@ package # hide from PAUSE DBICTest::Schema::Employee; +use warnings; +use strict; + use base qw/DBICTest::BaseResult/; __PACKAGE__->load_components(qw( Ordered )); diff --git a/t/lib/DBICTest/Schema/Encoded.pm b/t/lib/DBICTest/Schema/Encoded.pm index 234846d..aab5d9f 100644 --- a/t/lib/DBICTest/Schema/Encoded.pm +++ b/t/lib/DBICTest/Schema/Encoded.pm @@ -1,11 +1,11 @@ package # hide from PAUSE DBICTest::Schema::Encoded; -use base qw/DBICTest::BaseResult/; - use strict; use warnings; +use base qw/DBICTest::BaseResult/; + __PACKAGE__->table('encoded'); __PACKAGE__->add_columns( 'id' => { diff --git a/t/lib/DBICTest/Schema/Event.pm b/t/lib/DBICTest/Schema/Event.pm index 29bf11d..624cc7c 100644 --- a/t/lib/DBICTest/Schema/Event.pm +++ b/t/lib/DBICTest/Schema/Event.pm @@ -2,6 +2,7 @@ package DBICTest::Schema::Event; use strict; use warnings; + use base qw/DBICTest::BaseResult/; __PACKAGE__->load_components(qw/InflateColumn::DateTime/); diff --git a/t/lib/DBICTest/Schema/EventSmallDT.pm b/t/lib/DBICTest/Schema/EventSmallDT.pm index 560581d..7da8ea1 100644 --- a/t/lib/DBICTest/Schema/EventSmallDT.pm +++ b/t/lib/DBICTest/Schema/EventSmallDT.pm @@ -2,6 +2,7 @@ package DBICTest::Schema::EventSmallDT; use strict; use warnings; + use base qw/DBICTest::BaseResult/; __PACKAGE__->load_components(qw/InflateColumn::DateTime/); diff --git a/t/lib/DBICTest/Schema/EventTZ.pm b/t/lib/DBICTest/Schema/EventTZ.pm index 2d8df28..4c6c48a 100644 --- a/t/lib/DBICTest/Schema/EventTZ.pm +++ b/t/lib/DBICTest/Schema/EventTZ.pm @@ -2,6 +2,7 @@ package DBICTest::Schema::EventTZ; use strict; use warnings; + use base qw/DBICTest::BaseResult/; __PACKAGE__->load_components(qw/InflateColumn::DateTime/); diff --git a/t/lib/DBICTest/Schema/EventTZDeprecated.pm b/t/lib/DBICTest/Schema/EventTZDeprecated.pm index a667976..c66cd07 100644 --- a/t/lib/DBICTest/Schema/EventTZDeprecated.pm +++ b/t/lib/DBICTest/Schema/EventTZDeprecated.pm @@ -2,6 +2,7 @@ package DBICTest::Schema::EventTZDeprecated; use strict; use warnings; + use base qw/DBICTest::BaseResult/; __PACKAGE__->load_components(qw/InflateColumn::DateTime/); diff --git a/t/lib/DBICTest/Schema/EventTZPg.pm b/t/lib/DBICTest/Schema/EventTZPg.pm index 521a9c4..1f191af 100644 --- a/t/lib/DBICTest/Schema/EventTZPg.pm +++ b/t/lib/DBICTest/Schema/EventTZPg.pm @@ -2,6 +2,7 @@ package DBICTest::Schema::EventTZPg; use strict; use warnings; + use base qw/DBICTest::BaseResult/; __PACKAGE__->load_components(qw/InflateColumn::DateTime/); diff --git a/t/lib/DBICTest/Schema/ForceForeign.pm b/t/lib/DBICTest/Schema/ForceForeign.pm index c340d8b..a870f3e 100644 --- a/t/lib/DBICTest/Schema/ForceForeign.pm +++ b/t/lib/DBICTest/Schema/ForceForeign.pm @@ -1,6 +1,9 @@ package # hide from PAUSE DBICTest::Schema::ForceForeign; +use warnings; +use strict; + use base qw/DBICTest::BaseResult/; __PACKAGE__->table('forceforeign'); diff --git a/t/lib/DBICTest/Schema/FourKeys.pm b/t/lib/DBICTest/Schema/FourKeys.pm index 442a3e0..dc48b2b 100644 --- a/t/lib/DBICTest/Schema/FourKeys.pm +++ b/t/lib/DBICTest/Schema/FourKeys.pm @@ -1,6 +1,9 @@ package # hide from PAUSE DBICTest::Schema::FourKeys; +use warnings; +use strict; + use base qw/DBICTest::BaseResult/; __PACKAGE__->table('fourkeys'); diff --git a/t/lib/DBICTest/Schema/FourKeys_to_TwoKeys.pm b/t/lib/DBICTest/Schema/FourKeys_to_TwoKeys.pm index f4e9aa4..a208135 100644 --- a/t/lib/DBICTest/Schema/FourKeys_to_TwoKeys.pm +++ b/t/lib/DBICTest/Schema/FourKeys_to_TwoKeys.pm @@ -1,6 +1,9 @@ package # hide from PAUSE DBICTest::Schema::FourKeys_to_TwoKeys; +use warnings; +use strict; + use base qw/DBICTest::BaseResult/; __PACKAGE__->table('fourkeys_to_twokeys'); diff --git a/t/lib/DBICTest/Schema/Genre.pm b/t/lib/DBICTest/Schema/Genre.pm index dceabc9..461526e 100644 --- a/t/lib/DBICTest/Schema/Genre.pm +++ b/t/lib/DBICTest/Schema/Genre.pm @@ -1,5 +1,6 @@ package DBICTest::Schema::Genre; +use warnings; use strict; use base qw/DBICTest::BaseResult/; diff --git a/t/lib/DBICTest/Schema/Image.pm b/t/lib/DBICTest/Schema/Image.pm index d9e295e..bfaf7eb 100644 --- a/t/lib/DBICTest/Schema/Image.pm +++ b/t/lib/DBICTest/Schema/Image.pm @@ -1,6 +1,9 @@ package # hide from PAUSE DBICTest::Schema::Image; +use warnings; +use strict; + use base qw/DBICTest::BaseResult/; __PACKAGE__->table('images'); diff --git a/t/lib/DBICTest/Schema/LinerNotes.pm b/t/lib/DBICTest/Schema/LinerNotes.pm index b7e3da2..6c75f25 100644 --- a/t/lib/DBICTest/Schema/LinerNotes.pm +++ b/t/lib/DBICTest/Schema/LinerNotes.pm @@ -1,6 +1,9 @@ package # hide from PAUSE DBICTest::Schema::LinerNotes; +use warnings; +use strict; + use base qw/DBICTest::BaseResult/; __PACKAGE__->table('liner_notes'); diff --git a/t/lib/DBICTest/Schema/Link.pm b/t/lib/DBICTest/Schema/Link.pm index 19b7aa0..50ddf3f 100644 --- a/t/lib/DBICTest/Schema/Link.pm +++ b/t/lib/DBICTest/Schema/Link.pm @@ -1,11 +1,11 @@ package # hide from PAUSE DBICTest::Schema::Link; -use base qw/DBICTest::BaseResult/; - use strict; use warnings; +use base qw/DBICTest::BaseResult/; + __PACKAGE__->table('link'); __PACKAGE__->add_columns( 'id' => { diff --git a/t/lib/DBICTest/Schema/LyricVersion.pm b/t/lib/DBICTest/Schema/LyricVersion.pm index 2a409ab..fb55738 100644 --- a/t/lib/DBICTest/Schema/LyricVersion.pm +++ b/t/lib/DBICTest/Schema/LyricVersion.pm @@ -1,6 +1,9 @@ package # hide from PAUSE DBICTest::Schema::LyricVersion; +use warnings; +use strict; + use base qw/DBICTest::BaseResult/; __PACKAGE__->table('lyric_versions'); diff --git a/t/lib/DBICTest/Schema/Lyrics.pm b/t/lib/DBICTest/Schema/Lyrics.pm index 02ea191..bb0a56b 100644 --- a/t/lib/DBICTest/Schema/Lyrics.pm +++ b/t/lib/DBICTest/Schema/Lyrics.pm @@ -1,6 +1,9 @@ package # hide from PAUSE DBICTest::Schema::Lyrics; +use warnings; +use strict; + use base qw/DBICTest::BaseResult/; __PACKAGE__->table('lyrics'); diff --git a/t/lib/DBICTest/Schema/Money.pm b/t/lib/DBICTest/Schema/Money.pm index 91d0629..77e1844 100644 --- a/t/lib/DBICTest/Schema/Money.pm +++ b/t/lib/DBICTest/Schema/Money.pm @@ -1,6 +1,9 @@ package # hide from PAUSE DBICTest::Schema::Money; +use warnings; +use strict; + use base qw/DBICTest::BaseResult/; __PACKAGE__->table('money_test'); diff --git a/t/lib/DBICTest/Schema/NoPrimaryKey.pm b/t/lib/DBICTest/Schema/NoPrimaryKey.pm index 20841f1..ea4da6b 100644 --- a/t/lib/DBICTest/Schema/NoPrimaryKey.pm +++ b/t/lib/DBICTest/Schema/NoPrimaryKey.pm @@ -1,6 +1,9 @@ package # hide from PAUSE DBICTest::Schema::NoPrimaryKey; +use warnings; +use strict; + use base qw/DBICTest::BaseResult/; __PACKAGE__->table('noprimarykey'); diff --git a/t/lib/DBICTest/Schema/NoSuchClass.pm b/t/lib/DBICTest/Schema/NoSuchClass.pm index 2730b3a..2bb98ec 100644 --- a/t/lib/DBICTest/Schema/NoSuchClass.pm +++ b/t/lib/DBICTest/Schema/NoSuchClass.pm @@ -1,5 +1,8 @@ package DBICTest::Schema::NoSuchClass; +use warnings; +use strict; + ## This is purposefully not a real DBIC class ## Used in t/102load_classes.t diff --git a/t/lib/DBICTest/Schema/OneKey.pm b/t/lib/DBICTest/Schema/OneKey.pm index 6e5aa2d..06b4e00 100644 --- a/t/lib/DBICTest/Schema/OneKey.pm +++ b/t/lib/DBICTest/Schema/OneKey.pm @@ -1,6 +1,9 @@ package # hide from PAUSE DBICTest::Schema::OneKey; +use warnings; +use strict; + use base qw/DBICTest::BaseResult/; __PACKAGE__->table('onekey'); diff --git a/t/lib/DBICTest/Schema/Owners.pm b/t/lib/DBICTest/Schema/Owners.pm index 600980f..0df64a8 100644 --- a/t/lib/DBICTest/Schema/Owners.pm +++ b/t/lib/DBICTest/Schema/Owners.pm @@ -1,6 +1,9 @@ package # hide from PAUSE DBICTest::Schema::Owners; +use warnings; +use strict; + use base qw/DBICTest::BaseResult/; __PACKAGE__->table('owners'); diff --git a/t/lib/DBICTest/Schema/Producer.pm b/t/lib/DBICTest/Schema/Producer.pm index 903e3c4..3e722e6 100644 --- a/t/lib/DBICTest/Schema/Producer.pm +++ b/t/lib/DBICTest/Schema/Producer.pm @@ -1,6 +1,9 @@ package # hide from PAUSE DBICTest::Schema::Producer; +use warnings; +use strict; + use base qw/DBICTest::BaseResult/; __PACKAGE__->table('producer'); diff --git a/t/lib/DBICTest/Schema/PunctuatedColumnName.pm b/t/lib/DBICTest/Schema/PunctuatedColumnName.pm index e8a6454..828a58c 100644 --- a/t/lib/DBICTest/Schema/PunctuatedColumnName.pm +++ b/t/lib/DBICTest/Schema/PunctuatedColumnName.pm @@ -1,6 +1,9 @@ package # hide from PAUSE DBICTest::Schema::PunctuatedColumnName; +use warnings; +use strict; + use base qw/DBICTest::BaseResult/; __PACKAGE__->table('punctuated_column_name'); diff --git a/t/lib/DBICTest/Schema/SelfRef.pm b/t/lib/DBICTest/Schema/SelfRef.pm index 2a6b07e..41ae6d9 100644 --- a/t/lib/DBICTest/Schema/SelfRef.pm +++ b/t/lib/DBICTest/Schema/SelfRef.pm @@ -1,6 +1,9 @@ package # hide from PAUSE DBICTest::Schema::SelfRef; +use warnings; +use strict; + use base qw/DBICTest::BaseResult/; __PACKAGE__->table('self_ref'); diff --git a/t/lib/DBICTest/Schema/SelfRefAlias.pm b/t/lib/DBICTest/Schema/SelfRefAlias.pm index ac5d442..aaf453e 100644 --- a/t/lib/DBICTest/Schema/SelfRefAlias.pm +++ b/t/lib/DBICTest/Schema/SelfRefAlias.pm @@ -1,6 +1,9 @@ package # hide from PAUSE DBICTest::Schema::SelfRefAlias; +use warnings; +use strict; + use base qw/DBICTest::BaseResult/; __PACKAGE__->table('self_ref_alias'); diff --git a/t/lib/DBICTest/Schema/SequenceTest.pm b/t/lib/DBICTest/Schema/SequenceTest.pm index 6bd3f8a..bd236f7 100644 --- a/t/lib/DBICTest/Schema/SequenceTest.pm +++ b/t/lib/DBICTest/Schema/SequenceTest.pm @@ -1,6 +1,9 @@ package # hide from PAUSE DBICTest::Schema::SequenceTest; +use warnings; +use strict; + use base qw/DBICTest::BaseResult/; __PACKAGE__->table('sequence_test'); diff --git a/t/lib/DBICTest/Schema/Serialized.pm b/t/lib/DBICTest/Schema/Serialized.pm index 0642e8b..1de158e 100644 --- a/t/lib/DBICTest/Schema/Serialized.pm +++ b/t/lib/DBICTest/Schema/Serialized.pm @@ -1,6 +1,9 @@ package # hide from PAUSE DBICTest::Schema::Serialized; +use warnings; +use strict; + use base qw/DBICTest::BaseResult/; __PACKAGE__->table('serialized'); diff --git a/t/lib/DBICTest/Schema/Tag.pm b/t/lib/DBICTest/Schema/Tag.pm index ad56361..40bd945 100644 --- a/t/lib/DBICTest/Schema/Tag.pm +++ b/t/lib/DBICTest/Schema/Tag.pm @@ -1,6 +1,9 @@ package # hide from PAUSE DBICTest::Schema::Tag; +use warnings; +use strict; + use base qw/DBICTest::BaseResult/; __PACKAGE__->table('tags'); diff --git a/t/lib/DBICTest/Schema/TimestampPrimaryKey.pm b/t/lib/DBICTest/Schema/TimestampPrimaryKey.pm index 300a5dc..8ec4cf9 100644 --- a/t/lib/DBICTest/Schema/TimestampPrimaryKey.pm +++ b/t/lib/DBICTest/Schema/TimestampPrimaryKey.pm @@ -1,6 +1,9 @@ package # hide from PAUSE DBICTest::Schema::TimestampPrimaryKey; +use warnings; +use strict; + use base qw/DBICTest::BaseResult/; __PACKAGE__->table('timestamp_primary_key_test'); diff --git a/t/lib/DBICTest/Schema/Track.pm b/t/lib/DBICTest/Schema/Track.pm index e1e56b4..b82545a 100644 --- a/t/lib/DBICTest/Schema/Track.pm +++ b/t/lib/DBICTest/Schema/Track.pm @@ -1,6 +1,9 @@ package # hide from PAUSE DBICTest::Schema::Track; +use warnings; +use strict; + use base qw/DBICTest::BaseResult/; use Carp qw/confess/; diff --git a/t/lib/DBICTest/Schema/TreeLike.pm b/t/lib/DBICTest/Schema/TreeLike.pm index 21b1ef3..853bfe6 100644 --- a/t/lib/DBICTest/Schema/TreeLike.pm +++ b/t/lib/DBICTest/Schema/TreeLike.pm @@ -1,6 +1,9 @@ package # hide from PAUSE DBICTest::Schema::TreeLike; +use warnings; +use strict; + use base qw/DBICTest::BaseResult/; __PACKAGE__->table('treelike'); diff --git a/t/lib/DBICTest/Schema/TwoKeyTreeLike.pm b/t/lib/DBICTest/Schema/TwoKeyTreeLike.pm index 79c7405..b28fc48 100644 --- a/t/lib/DBICTest/Schema/TwoKeyTreeLike.pm +++ b/t/lib/DBICTest/Schema/TwoKeyTreeLike.pm @@ -1,6 +1,9 @@ package # hide from PAUSE DBICTest::Schema::TwoKeyTreeLike; +use warnings; +use strict; + use base qw/DBICTest::BaseResult/; __PACKAGE__->table('twokeytreelike'); diff --git a/t/lib/DBICTest/Schema/TwoKeys.pm b/t/lib/DBICTest/Schema/TwoKeys.pm index bfb6c42..ff8f980 100644 --- a/t/lib/DBICTest/Schema/TwoKeys.pm +++ b/t/lib/DBICTest/Schema/TwoKeys.pm @@ -1,6 +1,9 @@ package # hide from PAUSE DBICTest::Schema::TwoKeys; +use warnings; +use strict; + use base qw/DBICTest::BaseResult/; __PACKAGE__->table('twokeys'); diff --git a/t/lib/DBICTest/Schema/TypedObject.pm b/t/lib/DBICTest/Schema/TypedObject.pm index 7679c5e..c56fe3a 100644 --- a/t/lib/DBICTest/Schema/TypedObject.pm +++ b/t/lib/DBICTest/Schema/TypedObject.pm @@ -1,6 +1,9 @@ package # hide from PAUSE DBICTest::Schema::TypedObject; +use warnings; +use strict; + use base qw/DBICTest::BaseResult/; __PACKAGE__->table('typed_object'); diff --git a/t/lib/DBICTest/Schema/VaryingMAX.pm b/t/lib/DBICTest/Schema/VaryingMAX.pm index beca65f..9549483 100644 --- a/t/lib/DBICTest/Schema/VaryingMAX.pm +++ b/t/lib/DBICTest/Schema/VaryingMAX.pm @@ -1,6 +1,9 @@ package # hide from PAUSE DBICTest::Schema::VaryingMAX; +use warnings; +use strict; + use base qw/DBICTest::BaseResult/; # Test VARCHAR(MAX) type for MSSQL (used in ADO tests) diff --git a/t/lib/DBICTest/Schema/Year1999CDs.pm b/t/lib/DBICTest/Schema/Year1999CDs.pm index db3bc3f..e13f044 100644 --- a/t/lib/DBICTest/Schema/Year1999CDs.pm +++ b/t/lib/DBICTest/Schema/Year1999CDs.pm @@ -2,6 +2,9 @@ package # hide from PAUSE DBICTest::Schema::Year1999CDs; ## Used in 104view.t +use warnings; +use strict; + use base qw/DBICTest::BaseResult/; __PACKAGE__->table_class('DBIx::Class::ResultSource::View'); diff --git a/t/lib/DBICTest/Schema/Year2000CDs.pm b/t/lib/DBICTest/Schema/Year2000CDs.pm index 2fc30aa..f0890a3 100644 --- a/t/lib/DBICTest/Schema/Year2000CDs.pm +++ b/t/lib/DBICTest/Schema/Year2000CDs.pm @@ -1,6 +1,9 @@ package # hide from PAUSE DBICTest::Schema::Year2000CDs; +use warnings; +use strict; + use base qw/DBICTest::Schema::CD/; __PACKAGE__->table_class('DBIx::Class::ResultSource::View'); diff --git a/t/lib/DBICTest/SyntaxErrorComponent3.pm b/t/lib/DBICTest/SyntaxErrorComponent3.pm index 34f3c3f..b68f691 100644 --- a/t/lib/DBICTest/SyntaxErrorComponent3.pm +++ b/t/lib/DBICTest/SyntaxErrorComponent3.pm @@ -1,5 +1,6 @@ package DBICErrorTest::SyntaxError; use strict; +use warnings; I'm a syntax error! diff --git a/t/lib/DBICTest/Taint/Classes/Auto.pm b/t/lib/DBICTest/Taint/Classes/Auto.pm index e33903c..81e8105 100644 --- a/t/lib/DBICTest/Taint/Classes/Auto.pm +++ b/t/lib/DBICTest/Taint/Classes/Auto.pm @@ -1,6 +1,9 @@ package # hide from PAUSE DBICTest::Taint::Classes::Auto; +use warnings; +use strict; + use base 'DBIx::Class::Core'; __PACKAGE__->table('test'); diff --git a/t/lib/DBICTest/Taint/Classes/Manual.pm b/t/lib/DBICTest/Taint/Classes/Manual.pm index 5dd73c1..a7ad2c8 100644 --- a/t/lib/DBICTest/Taint/Classes/Manual.pm +++ b/t/lib/DBICTest/Taint/Classes/Manual.pm @@ -1,6 +1,9 @@ package # hide from PAUSE DBICTest::Taint::Classes::Manual; +use warnings; +use strict; + use base 'DBIx::Class::Core'; __PACKAGE__->table('test'); diff --git a/t/lib/DBICTest/Taint/Namespaces/Result/Test.pm b/t/lib/DBICTest/Taint/Namespaces/Result/Test.pm index 1bae3ed..b9b7034 100644 --- a/t/lib/DBICTest/Taint/Namespaces/Result/Test.pm +++ b/t/lib/DBICTest/Taint/Namespaces/Result/Test.pm @@ -1,6 +1,9 @@ package # hide from PAUSE DBICTest::Taint::Namespaces::Result::Test; +use warnings; +use strict; + use base 'DBIx::Class::Core'; __PACKAGE__->table('test'); diff --git a/t/lib/testinclude/DBICTestAdminInc.pm b/t/lib/testinclude/DBICTestAdminInc.pm index 9f57e2f..212d33d 100644 --- a/t/lib/testinclude/DBICTestAdminInc.pm +++ b/t/lib/testinclude/DBICTestAdminInc.pm @@ -1,4 +1,8 @@ package DBICTestAdminInc; + +use warnings; +use strict; + use base 'DBICTest::BaseSchema'; sub connect { exit 70 } # this is what the test will expect to see diff --git a/t/lib/testinclude/DBICTestConfig.pm b/t/lib/testinclude/DBICTestConfig.pm index d9fa7ed..e531dc4 100644 --- a/t/lib/testinclude/DBICTestConfig.pm +++ b/t/lib/testinclude/DBICTestConfig.pm @@ -1,4 +1,8 @@ package DBICTestConfig; + +use warnings; +use strict; + use base 'DBICTest::BaseSchema'; sub connect { diff --git a/t/prefetch/attrs_untouched.t b/t/prefetch/attrs_untouched.t index be336e4..b2f25c3 100644 --- a/t/prefetch/attrs_untouched.t +++ b/t/prefetch/attrs_untouched.t @@ -1,4 +1,5 @@ use warnings; +use strict; use Test::More; use lib qw(t/lib); diff --git a/t/prefetch/double_prefetch.t b/t/prefetch/double_prefetch.t index efc9d2d..954e335 100644 --- a/t/prefetch/double_prefetch.t +++ b/t/prefetch/double_prefetch.t @@ -1,4 +1,5 @@ use warnings; +use strict; use Test::More; use lib qw(t/lib); diff --git a/t/prefetch/join_type.t b/t/prefetch/join_type.t index f077229..48f9712 100644 --- a/t/prefetch/join_type.t +++ b/t/prefetch/join_type.t @@ -1,4 +1,5 @@ use warnings; +use strict; use Test::More; use lib qw(t/lib); diff --git a/xt/strictures.t b/xt/strictures.t new file mode 100644 index 0000000..9e94cfa --- /dev/null +++ b/xt/strictures.t @@ -0,0 +1,45 @@ +use warnings; +use strict; + +use Test::More; +use lib 't/lib'; +use DBICTest ':GlobalLock'; + +unless ( DBIx::Class::Optional::Dependencies->req_ok_for ('test_strictures') ) { + my $missing = DBIx::Class::Optional::Dependencies->req_missing_for ('test_strictures'); + $ENV{RELEASE_TESTING} + ? die ("Failed to load release-testing module requirements: $missing") + : plan skip_all => "Test needs: $missing" +} + + +use File::Find; + +find({ + wanted => sub { + -f $_ or return; + m/\.(?: pm | pl | t )$ /ix or return; + + return if m{^(?: + maint/Makefile.PL.inc/.+ # all the maint inc snippets are auto-strictured + | + lib/DBIx/Class/Admin/Types.pm # MooseX::Types undetected + | + lib/DBIx/Class/Storage/DBI/Replicated/Types.pm # MooseX::Types undetected + | + lib/DBIx/Class/Storage/BlockRunner.pm # Moo undetected + | + t/lib/DBICTest/Util/OverrideRequire.pm # no stictures by design (load order sensitive) + )$}x; + + my $f = $_; + + Test::Strict::strict_ok($f); + Test::Strict::warnings_ok($f); + + #Test::Strict::syntax_ok($f) if $f =~ /^ (?: lib )/x; + }, + no_chdir => 1, +}, (qw(lib t examples maint)) ); + +done_testing;