File tree Expand file tree Collapse file tree 8 files changed +20
-0
lines changed
Expand file tree Collapse file tree 8 files changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -35,12 +35,14 @@ use warnings;
3535
3636use base 'Gherkin::ParserBase';
3737
38+ ## no critic (ProhibitMagicNumbers)
3839my %states_to_match_names = (
3940 @foreach( var state in Model .States .Values .Where (s => ! s .IsEndState )) //..
4041 {
4142@: @state.Id => 'match_token_at_@(state.Id)' ,
4243 }
4344);
45+ ## use critic
4446
4547sub parse {
4648 my ( $self , $token_scanner , $uri ) = @@_ ;
@@ -94,6 +96,7 @@ sub _construct_parser_error {
9496 return $error_class ->new ( $token , @@args );
9597}
9698
99+ ## no critic (ProhibitExcessComplexity, ProhibitMagicNumbers, ProhibitPostfixControls)
97100@foreach( var state in Model .States .Values .Where (s => ! s .IsEndState )) //..
98101{ <text >
99102# @Raw(state.Comment)
@@ -126,6 +129,7 @@ sub match_token_at_@(state.Id) {
126129</text >
127130}
128131
132+ ## use critic
129133@foreach( var lookAheadHint in Model .RuleSet .LookAheadHints )
130134{
131135<text >
Original file line number Diff line number Diff line change @@ -39,8 +39,10 @@ sub from_paths {
3939 # accommodates the errors and simply continues, allowing us to
4040 # recode back to octets and then to the encoding indicated in the
4141 # header using the "# encoding: ..." header.
42+ # # no critic (RequireEncodingWithUTF8Layer)
4243 open my $fh , ' <:utf8' , $path
4344 or die " Unable to open gherkin document $path : $! " ;
45+ # # use critic
4446
4547 # local $/ = undef; --> unset 'end-of-line' marker: slurp entire file
4648 # use the 'do' block to scope this binding to smallest possible scope
Original file line number Diff line number Diff line change @@ -165,6 +165,7 @@ sub next_id {
165165 return $self -> {' id_generator' }-> ();
166166}
167167
168+ # # no critic (ProhibitExcessComplexity, ProhibitCascadingIfElse)
168169sub transform_node {
169170 my ( $self , $node ) = @_ ;
170171
@@ -358,5 +359,6 @@ sub transform_node {
358359 return $node ;
359360 }
360361}
362+ # # use critic
361363
3623641;
Original file line number Diff line number Diff line change @@ -23,8 +23,10 @@ sub new {
2323 close $fh ;
2424 $options -> {' dictionary' } = Cpanel::JSON::XS::decode_json($input );
2525 } else {
26+ # # no critic (ProhibitPackageVars)
2627 require Gherkin::Generated::Languages;
2728 $options -> {' dictionary' } = $Gherkin::Generated::Languages::data ;
29+ # # use critic
2830 }
2931 }
3032
Original file line number Diff line number Diff line change 1+ # # no critic (ProhibitMultiplePackages, RequireExplicitPackage)
2+
13use strict;
24use warnings;
35
Original file line number Diff line number Diff line change @@ -6,6 +6,7 @@ use warnings;
66
77use base ' Gherkin::ParserBase' ;
88
9+ # # no critic (ProhibitMagicNumbers)
910my %states_to_match_names = (
1011 0 => ' match_token_at_0' ,
1112 1 => ' match_token_at_1' ,
@@ -50,6 +51,7 @@ my %states_to_match_names = (
5051 41 => ' match_token_at_41' ,
5152 42 => ' match_token_at_42' ,
5253);
54+ # # use critic
5355
5456sub parse {
5557 my ( $self , $token_scanner , $uri ) = @_ ;
@@ -103,6 +105,7 @@ sub _construct_parser_error {
103105 return $error_class -> new( $token , @args );
104106}
105107
108+ # # no critic (ProhibitExcessComplexity, ProhibitMagicNumbers, ProhibitPostfixControls)
106109
107110# Start
108111sub match_token_at_0 {
@@ -3879,6 +3882,7 @@ sub match_token_at_42 {
38793882 return 42;
38803883}
38813884
3885+ # # use critic
38823886
38833887sub lookahead_0 {
38843888 my ($self , $context , $current_token ) = @_ ;
Original file line number Diff line number Diff line change @@ -43,6 +43,8 @@ sub add_error {
4343 return ;
4444}
4545
46+ # # no critic (Subroutines::ProhibitUnusedPrivateSubroutines)
47+
4648sub _start_rule {
4749 my ( $self , $context , $ruleType ) = @_ ;
4850
Original file line number Diff line number Diff line change @@ -16,6 +16,7 @@ sub new {
1616
1717 # Perl convention is that a string reference is the string itself, but that
1818 # a straight string is a path
19+ # # no critic (RequireBriefOpen)
1920 my $fh ;
2021 if ( ref $path_or_str eq ' SCALAR' ) {
2122 my $bytes = Encode::encode(' UTF-8' , ${ $path_or_str });
@@ -25,6 +26,7 @@ sub new {
2526 || croak " Can't open [$path_or_str ] for reading" ;
2627 $fh -> binmode (' :utf8' );
2728 }
29+ # # use critic
2830
2931 return bless { fh => $fh , line_number => 0 }, $class ;
3032}
You can’t perform that action at this time.
0 commit comments