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

[SCM] Debian package checker branch, master, updated. 2.0.0-48-gbdb64da



The following commit has been merged in the master branch:
commit bdb64da5dd8a5b306b5fff53b77f7995912f4a7f
Author: Adam D. Barratt <adam@adam-barratt.org.uk>
Date:   Mon Nov 24 23:37:44 2008 +0000

    Ignore square bracket delimited text when running "picky" spelling checks.
    
    lib/Spelling.pm:
      + Don't check text contained within square brackets for capitalisation
        mistakes.  This allows for lists such as "[ cvs | subversion ]" to be
        included.

diff --git a/debian/changelog b/debian/changelog
index 180189f..b97aae8 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -82,6 +82,9 @@ lintian (2.1.0) unstable; urgency=low
   * lib/Spelling.pm:
     + [RA] Add subversion to Subversion correction for package descriptions.
       Thanks, Sandro Tosi.  (Closes: #506793)
+    + [ADB] Don't check text contained within square brackets for
+      capitalisation mistakes.  This allows for lists such as "[ cvs |
+      subversion ]" to be included.
   * lib/Util.pm:
     + [FL] Convert to use Lintian::Output.
     + [FL] Add some new utility functions: delete_dir copy_dir gunzip_file
diff --git a/lib/Spelling.pm b/lib/Spelling.pm
index 02e692b..326ea96 100644
--- a/lib/Spelling.pm
+++ b/lib/Spelling.pm
@@ -438,6 +438,16 @@ sub spelling_check {
 sub spelling_check_picky {
     my ($tag, $text, $filename) = @_;
 
+    # Check this first in case it's contained in square brackets and
+    # removed below.
+    if ($text =~ m,meta\s+package,) {
+        _tag($tag, $filename, "meta package", "metapackage");
+    }
+
+    # Exclude text enclosed in square brackets as it could be a package list
+    # or similar which may legitimately contain lower-cased versions of
+    # the words.
+    $text =~ s/\[.+?\]//sg;
     for my $word (split(/\s+/, $text)) {
         $word =~ s/^\(|[).,?!:;]+$//g;
         if (exists $CORRECTIONS_CASE{$word}) {
@@ -445,9 +455,6 @@ sub spelling_check_picky {
             next;
         }
     }
-    if ($text =~ m,meta\s+package,) {
-        _tag($tag, $filename, "meta package", "metapackage");
-    }
 }
 
 1;
diff --git a/testset/binary/debian/control b/testset/binary/debian/control
index 88ec151..7aecae8 100644
--- a/testset/binary/debian/control
+++ b/testset/binary/debian/control
@@ -18,6 +18,9 @@ Description: test handling of binary files
  Regression test for lintian's handling of binary files for debian.  This
  is checked for picky spelling errors.
  .
+ This package list [ subversion | gconf ] should not be flagged as a spelling
+ mistake.
+ .
   Homepage: http://lintian.debian.org/
 
 Package: binary-data
@@ -27,6 +30,8 @@ Depends: binary (= ${Source-Version}), libssl-not-openssl,
 Description: test handling of binary relationships
  Regression test for lintian's checking of package relationships between
  arch:any and arch:all packages.
+ .
+ This mention of subversion should be flagged as a spelling mistake.
 
 #Package: binary-comment
 #Architecture: space-almonds
diff --git a/testset/tags.binary b/testset/tags.binary
index f5d7d61..33b28ff 100644
--- a/testset/tags.binary
+++ b/testset/tags.binary
@@ -64,6 +64,7 @@ W: binary source: native-package-with-dash-version
 W: binary source: substvar-source-version-is-deprecated binary
 W: binary source: substvar-source-version-is-deprecated binary-data
 W: binary-data: control-file-is-empty md5sums
+W: binary-data: spelling-error-in-description subversion Subversion
 W: binary: binary-without-manpage usr/bin/hello
 W: binary: binary-without-manpage usr/bin/hello-static
 W: binary: binary-without-manpage usr/bin/hello.static

-- 
Debian package checker


Reply to: