From 3ceb8fdc01475af94ba8099b5311cda66aa68251 Mon Sep 17 00:00:00 2001 From: simbabque Date: Sat, 29 Jul 2017 11:27:05 +0200 Subject: [PATCH 1/7] add Test::Compile --- dist.ini | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dist.ini b/dist.ini index beab1c6..f91c581 100644 --- a/dist.ini +++ b/dist.ini @@ -31,6 +31,7 @@ Test::More = 0.92 ; done_testing ;; -- Sets of additional tests we want to do as part of release [Test::Perl::Critic] [MetaTests] +[Test::Compile] ;; [PodCoverageTests] ; Currently we comprehensively fail these [OurPkgVersion] [PodVersion] @@ -65,4 +66,4 @@ allow_dirty = README.pod allow_dirty = Changes commit_msg = v%v%t - %d%n%n%c tag_format = v%v%t ; see Git::Tag -tag_message = v%v%t - %d ; see Git::Tag \ No newline at end of file +tag_message = v%v%t - %d ; see Git::Tag From 3bbf958514bf4129a51a31e22b5b8be2f69a94de Mon Sep 17 00:00:00 2001 From: simbabque Date: Sat, 29 Jul 2017 11:36:21 +0200 Subject: [PATCH 2/7] add Test::EOF and make tests pass --- dist.ini | 1 + t/01basic-token.t | 2 +- t/03instancepercontext.t | 2 +- t/elements/requesttoken.t | 2 +- 4 files changed, 4 insertions(+), 3 deletions(-) diff --git a/dist.ini b/dist.ini index f91c581..032a8b2 100644 --- a/dist.ini +++ b/dist.ini @@ -32,6 +32,7 @@ Test::More = 0.92 ; done_testing [Test::Perl::Critic] [MetaTests] [Test::Compile] +[Test::EOF] ;; [PodCoverageTests] ; Currently we comprehensively fail these [OurPkgVersion] [PodVersion] diff --git a/t/01basic-token.t b/t/01basic-token.t index 30835ca..d30b6da 100644 --- a/t/01basic-token.t +++ b/t/01basic-token.t @@ -73,4 +73,4 @@ ok( $res = $mech->submit_form( fields => { 'basic_form' => 1, '_token' => $token is( $mech->content, 'VALID', 'form is valid' ); -done_testing; \ No newline at end of file +done_testing; diff --git a/t/03instancepercontext.t b/t/03instancepercontext.t index a557dcc..f7ae7ae 100644 --- a/t/03instancepercontext.t +++ b/t/03instancepercontext.t @@ -12,4 +12,4 @@ eval { ok(!$@, 'lives ok'); -done_testing; \ No newline at end of file +done_testing; diff --git a/t/elements/requesttoken.t b/t/elements/requesttoken.t index b921b6c..1026650 100644 --- a/t/elements/requesttoken.t +++ b/t/elements/requesttoken.t @@ -28,4 +28,4 @@ sub new { return bless({}, shift) } sub session { return {} } -} \ No newline at end of file +} From d3367a4db4ef40d97d9ebc419d57957b43cac82b Mon Sep 17 00:00:00 2001 From: simbabque Date: Sat, 29 Jul 2017 12:00:25 +0200 Subject: [PATCH 3/7] add Test::NoTabs --- dist.ini | 3 +++ 1 file changed, 3 insertions(+) diff --git a/dist.ini b/dist.ini index 032a8b2..f374fec 100644 --- a/dist.ini +++ b/dist.ini @@ -33,6 +33,9 @@ Test::More = 0.92 ; done_testing [MetaTests] [Test::Compile] [Test::EOF] +[Test::NoTabs] +finder = :InstallModules + ;; [PodCoverageTests] ; Currently we comprehensively fail these [OurPkgVersion] [PodVersion] From aec27ca865089e1ed9fe232f4da4275197665362 Mon Sep 17 00:00:00 2001 From: simbabque Date: Sat, 29 Jul 2017 12:02:20 +0200 Subject: [PATCH 4/7] add Test::Portability --- dist.ini | 1 + 1 file changed, 1 insertion(+) diff --git a/dist.ini b/dist.ini index f374fec..9b3a811 100644 --- a/dist.ini +++ b/dist.ini @@ -35,6 +35,7 @@ Test::More = 0.92 ; done_testing [Test::EOF] [Test::NoTabs] finder = :InstallModules +[Test::Portability] ;; [PodCoverageTests] ; Currently we comprehensively fail these [OurPkgVersion] From 9bab4e40f9648dafed1d17556a87b84143e56f3d Mon Sep 17 00:00:00 2001 From: simbabque Date: Sat, 29 Jul 2017 12:14:03 +0200 Subject: [PATCH 5/7] add Test::PodSpelling and fix spelling mistakes --- dist.ini | 8 ++++++++ lib/Catalyst/Controller/HTML/FormFu.pm | 10 +++++----- lib/Catalyst/Helper/HTML/FormFu.pm | 4 ++-- 3 files changed, 15 insertions(+), 7 deletions(-) diff --git a/dist.ini b/dist.ini index 9b3a811..eb1f18a 100644 --- a/dist.ini +++ b/dist.ini @@ -36,6 +36,14 @@ Test::More = 0.92 ; done_testing [Test::NoTabs] finder = :InstallModules [Test::Portability] +[Test::PodSpelling] +stopword = TT +stopword = renderer +stopword = MultiForms +stopword = CSRF +stopword = formfu +stopword = Moritz ; we need these because there is ... +stopword = Onken ; no contributor list yet ;; [PodCoverageTests] ; Currently we comprehensively fail these [OurPkgVersion] diff --git a/lib/Catalyst/Controller/HTML/FormFu.pm b/lib/Catalyst/Controller/HTML/FormFu.pm index 3f9441f..aa36772 100644 --- a/lib/Catalyst/Controller/HTML/FormFu.pm +++ b/lib/Catalyst/Controller/HTML/FormFu.pm @@ -615,10 +615,10 @@ equivalent to C<< $c->uri_for( 'URI', \@ARGS ) >>. At this time, there is no way to pass query values equivalent to C<< $c->uri_for( 'URI', \@ARGS, \%QUERY_VALUES ) >>. -The second codeword that is being replaced is C<__path_to( @DIRS )__>. Any +The second code word that is being replaced is C<__path_to( @DIRS )__>. Any instance is replaced with the result of passing the C arguments to L. -Don't use qoutationmarks as they would become part of the path. +Don't use quotation marks as they would become part of the path. Default value: 1 @@ -633,7 +633,7 @@ Default value: C. If set to a true value the action for the form will be set to the currently called action path. -The action path includes concurrent to action name additioal parameters which +The action path includes concurrent to action name additional parameters which were code inside the path. Default value: C. @@ -682,7 +682,7 @@ Default value: C If you're using a L10N / I18N plugin such as L which provides a C method that returns a list of valid languages to use -for the currect request - and you want to use formfu's built-in I18N packages, +for the correct request - and you want to use formfu's built-in I18N packages, then setting L =head2 localize_from_context @@ -735,7 +735,7 @@ rendering the form. =head1 GITHUB REPOSITORY -This module's sourcecode is maintained in a git repository at +This module's source code is maintained in a git repository at L The project page is L diff --git a/lib/Catalyst/Helper/HTML/FormFu.pm b/lib/Catalyst/Helper/HTML/FormFu.pm index 336cb7f..0a80e0c 100644 --- a/lib/Catalyst/Helper/HTML/FormFu.pm +++ b/lib/Catalyst/Helper/HTML/FormFu.pm @@ -45,10 +45,10 @@ Catalyst::Helper::HTML::FormFu - Helper to deploy HTML::FormFu template files. As of version 0.02000, L doesn't use the TT template files by default - it uses in internal rendering engine. -If you don't want to customise the generated markup, you don't need to use +If you don't want to customize the generated markup, you don't need to use L at all. -If you want to customise the generated markup, you'll need a +If you want to customize the generated markup, you'll need a local copy of the template files. To create the files in the default C directory, run: From 3af1572bad9ecbbf82d97dc0f1d3bce89eeba9a5 Mon Sep 17 00:00:00 2001 From: simbabque Date: Sat, 29 Jul 2017 12:20:31 +0200 Subject: [PATCH 6/7] add Test::NoBreakpoints --- dist.ini | 1 + 1 file changed, 1 insertion(+) diff --git a/dist.ini b/dist.ini index eb1f18a..0e3a599 100644 --- a/dist.ini +++ b/dist.ini @@ -44,6 +44,7 @@ stopword = CSRF stopword = formfu stopword = Moritz ; we need these because there is ... stopword = Onken ; no contributor list yet +[Test::NoBreakpoints] ;; [PodCoverageTests] ; Currently we comprehensively fail these [OurPkgVersion] From 1a0f17977a60100aaee19da5315ade3371f3e862 Mon Sep 17 00:00:00 2001 From: simbabque Date: Sat, 29 Jul 2017 12:31:32 +0200 Subject: [PATCH 7/7] add Test::UnusedVars and remove unused variables to make the tests pass --- dist.ini | 2 +- lib/HTML/FormFu/Constraint/RequestToken.pm | 2 +- lib/HTML/FormFu/Element/RequestToken.pm | 2 -- lib/HTML/FormFu/Plugin/RequestToken.pm | 2 -- 4 files changed, 2 insertions(+), 6 deletions(-) diff --git a/dist.ini b/dist.ini index 0e3a599..d823758 100644 --- a/dist.ini +++ b/dist.ini @@ -45,7 +45,7 @@ stopword = formfu stopword = Moritz ; we need these because there is ... stopword = Onken ; no contributor list yet [Test::NoBreakpoints] - +[Test::UnusedVars] ;; [PodCoverageTests] ; Currently we comprehensively fail these [OurPkgVersion] [PodVersion] diff --git a/lib/HTML/FormFu/Constraint/RequestToken.pm b/lib/HTML/FormFu/Constraint/RequestToken.pm index fc082bb..27df06c 100644 --- a/lib/HTML/FormFu/Constraint/RequestToken.pm +++ b/lib/HTML/FormFu/Constraint/RequestToken.pm @@ -9,7 +9,7 @@ use Moose; extends 'HTML::FormFu::Constraint'; sub BUILD { - my ( $self, $args ) = @_; + my ( $self ) = @_; $self->message($self->parent->message); diff --git a/lib/HTML/FormFu/Element/RequestToken.pm b/lib/HTML/FormFu/Element/RequestToken.pm index aefa6ef..f5be4ea 100644 --- a/lib/HTML/FormFu/Element/RequestToken.pm +++ b/lib/HTML/FormFu/Element/RequestToken.pm @@ -42,8 +42,6 @@ sub verify_token { croak "verify_token() can only be called if form has been submitted" if !$form->submitted; - my $field_name = $self->name; - my $c = $self->form->stash->{ $self->context }; for ( @{ $c->session->{ $self->session_key } || [] } ) { diff --git a/lib/HTML/FormFu/Plugin/RequestToken.pm b/lib/HTML/FormFu/Plugin/RequestToken.pm index 25937a9..a86c81e 100644 --- a/lib/HTML/FormFu/Plugin/RequestToken.pm +++ b/lib/HTML/FormFu/Plugin/RequestToken.pm @@ -18,8 +18,6 @@ sub process { return if $self->form->get_all_element( { name => $self->field_name } ); - my $c = $self->form->stash->{'context'}; - $self->form->elements( [ { type => 'RequestToken', name => $self->field_name,