View | Details | Raw Unified | Return to bug 16003
Collapse All | Expand All

(-)a/QohA/File.pm (-4 / +20 lines)
Lines 80-85 sub check_spelling { Link Here
80
80
81
    return 0 unless @$full_buf;
81
    return 0 unless @$full_buf;
82
82
83
    my @exceptions = (
84
        qr{isnt\(},
85
    );
83
    # Encapsulate the potential errors
86
    # Encapsulate the potential errors
84
    my @errors;
87
    my @errors;
85
    my @lines = split /\n/, $full_buf->[0];
88
    my @lines = split /\n/, $full_buf->[0];
Lines 88-97 sub check_spelling { Link Here
88
91
89
        # Remove filepath and line numbers
92
        # Remove filepath and line numbers
90
        # my/file/path:xxx: indentifier  ==> identifier
93
        # my/file/path:xxx: indentifier  ==> identifier
91
        my $re = q|^| . $self->path . q|:\d+:|;
94
        my $re = q|^| . $self->path . q|:(\d+):|;
92
        $line =~ s|$re||;
95
        if ( $line =~ $re ) {
93
96
            my $line_number = $1;
94
        push @errors, $line;
97
            my $p = $self->path;
98
            my $guilty_line = `sed -n '${line_number}p' $p`;
99
            my $is_an_exception;
100
            for my $e ( @exceptions ) {
101
                if ( $guilty_line =~ $e ) {
102
                    $is_an_exception = 1;
103
                    last;
104
                }
105
            }
106
            unless ( $is_an_exception ) {
107
                $line =~ s|$re||;
108
                push @errors, $line;
109
            }
110
        }
95
    }
111
    }
96
112
97
    return @errors
113
    return @errors
(-)a/t/Perl.t (+8 lines)
Lines 92-97 eval { Link Here
92
    our $STATUS_OK = "${GREEN}OK${END}";
92
    our $STATUS_OK = "${GREEN}OK${END}";
93
    my $r_v0_expected = <<EOL;
93
    my $r_v0_expected = <<EOL;
94
 $STATUS_KO	perl/Authority.pm
94
 $STATUS_KO	perl/Authority.pm
95
 $STATUS_OK	perl/i_dont_fail_spelling.pl
95
 $STATUS_KO	perl/i_fail_license.pl
96
 $STATUS_KO	perl/i_fail_license.pl
96
 $STATUS_KO	perl/i_fail_spelling.pl
97
 $STATUS_KO	perl/i_fail_spelling.pl
97
 $STATUS_KO	perl/i_fail_template_name.pl
98
 $STATUS_KO	perl/i_fail_template_name.pl
Lines 119-124 EOL Link Here
119
   $STATUS_OK	  spelling
120
   $STATUS_OK	  spelling
120
   $STATUS_OK	  valid
121
   $STATUS_OK	  valid
121
122
123
 $STATUS_OK	perl/i_dont_fail_spelling.pl
124
   $STATUS_OK	  critic
125
   $STATUS_OK	  forbidden patterns
126
   $STATUS_OK	  pod
127
   $STATUS_OK	  spelling
128
   $STATUS_OK	  valid
129
122
 $STATUS_KO	perl/i_fail_license.pl
130
 $STATUS_KO	perl/i_fail_license.pl
123
   $STATUS_OK	  critic
131
   $STATUS_OK	  critic
124
   $STATUS_KO	  forbidden patterns
132
   $STATUS_KO	  forbidden patterns
(-)a/t/data/5/perl/i_dont_fail_spelling.pl (-1 / +4 lines)
Line 0 Link Here
0
- 
1
use Modern::Perl;
2
use Test::More tests => 1;
3
4
isnt(1, 1, 'This is a correct spelling');

Return to bug 16003