[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

[lintian] 02/02: Add spellchecking of check info (but not tags info)



This is an automated email from the git hooks/post-receive script.

nthykier pushed a commit to branch master
in repository lintian.

commit 2b83763de56214a6c64541eddafbc6dbb0055d64
Author: Niels Thykier <niels@thykier.net>
Date:   Sat Aug 6 11:42:10 2016 +0000

    Add spellchecking of check info (but not tags info)
    
    Signed-off-by: Niels Thykier <niels@thykier.net>
---
 lib/Test/Lintian.pm | 24 +++++++++++++++---------
 1 file changed, 15 insertions(+), 9 deletions(-)

diff --git a/lib/Test/Lintian.pm b/lib/Test/Lintian.pm
index 14b05a6..c11b378 100644
--- a/lib/Test/Lintian.pm
+++ b/lib/Test/Lintian.pm
@@ -226,15 +226,18 @@ sub test_check_desc {
                 'Needs-Info test checks skipped due to empty coll-dir')
               if $needs ne '';
         }
-
-        my $mistakes = 0;
-        my $handler = sub {
-            my ($incorrect, $correct) = @_;
-            $builder->diag("Spelling ($cname): $incorrect => $correct");
-            $mistakes++;
-        };
-        $builder->is_eq($mistakes, 0,"$cname Info has no spelling errors");
-
+        if (my $d = $header->{'info'}) {
+            my $mistakes = 0;
+            my $handler = sub {
+                my ($incorrect, $correct) = @_;
+                $builder->diag("Spelling ($cname): $incorrect => $correct");
+                $mistakes++;
+            };
+            check_spelling($d, $handler);
+            $builder->is_eq($mistakes, 0, "$cname Info has no spelling errors");
+        } else {
+            $builder->fail("$cname has an Info field");
+        }
         foreach my $tpara (@tagpara) {
             my $tag = $tpara->{'tag'}//'';
             my $severity = $tpara->{'severity'}//'';
@@ -269,6 +272,9 @@ sub test_check_desc {
                     "Spelling ($cname/$tag): $incorrect => $correct");
                 $mistakes++;
             };
+            # FIXME: There are a couple of known false-positives that breaks the
+            # test.
+            # check_spelling($info, $handler);
             $builder->is_eq($mistakes, 0,
                 "$content_type $cname: $tag has no spelling errors");
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/lintian/lintian.git


Reply to: