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

lintian: r1091 - in trunk: checks debian lib testset testset/binary/debian



Author: rra
Date: 2008-01-03 05:28:21 +0100 (Thu, 03 Jan 2008)
New Revision: 1091

Modified:
   trunk/checks/description
   trunk/checks/description.desc
   trunk/checks/menus
   trunk/checks/menus.desc
   trunk/debian/changelog
   trunk/lib/Spelling.pm
   trunk/testset/binary/debian/control
   trunk/testset/binary/debian/copyright
   trunk/testset/binary/debian/doc-base
   trunk/testset/tags.binary
   trunk/testset/tags.manpages
Log:
* checks/description{.desc,}:
  + [RA] Do picky spelling and capitalization checks on the description
    and note and explain this in the long description.
* checks/menus{.desc,}:
  + [RA] Spelling errors in doc-base files should only be warnings.  Do
    picky spelling and capitalization checks on the abstract and title
    fields.
* lib/Spelling.pm:
  + [RA] Stop doing capitalization checks on all files; there's too much
    of a risk of false positives.  Instead, provide a separate picky
    spelling check function for package descriptions and similar cases
    where we're more sure of the contents.
  + [RA] Expand the picky capitalization checks to catch Debian, GNOME,
    KDE, and Linux.  (Closes: #456582)

Modified: trunk/checks/description
===================================================================
--- trunk/checks/description	2008-01-03 03:56:25 UTC (rev 1090)
+++ trunk/checks/description	2008-01-03 04:28:21 UTC (rev 1091)
@@ -138,8 +138,15 @@
 
 if ($description) {
     spelling_check('spelling-error-in-description', $description);
+    spelling_check_picky('spelling-error-in-description', $description);
 }
 
 }
 
 1;
+
+# Local Variables:
+# indent-tabs-mode: t
+# cperl-indent-level: 4
+# End:
+# vim: syntax=perl sw=4 ts=8

Modified: trunk/checks/description.desc
===================================================================
--- trunk/checks/description.desc	2008-01-03 03:56:25 UTC (rev 1090)
+++ trunk/checks/description.desc	2008-01-03 04:28:21 UTC (rev 1091)
@@ -107,6 +107,8 @@
 
 Tag: spelling-error-in-description
 Type: warning
-Info: Lintian found a spelling error in the package description.  Lintian
- has a list of common misspellings that it looks for.  It does not have a
- dictionary like a spelling checker does.
+Info: Lintian found a spelling or capitalization error in the package
+ description.  Lintian has a list of common misspellings that it looks
+ for.  It does not have a dictionary like a spelling checker does.  It is
+ particularly picky about spelling and capitalization in package
+ descriptions since they're very visible to end users.

Modified: trunk/checks/menus
===================================================================
--- trunk/checks/menus	2008-01-03 03:56:25 UTC (rev 1090)
+++ trunk/checks/menus	2008-01-03 04:28:21 UTC (rev 1091)
@@ -376,6 +376,8 @@
         if (@$vals) {
             spelling_check("spelling-error-in-doc-base-title-field",
                            join (' ', @$vals), "$dbfile:$line");
+            spelling_check_picky("spelling-error-in-doc-base-title-field",
+                                 join (' ', @$vals), "$dbfile:$line");
         }
 
     # Abstract field.
@@ -428,6 +430,8 @@
         if (@$vals) {
             spelling_check("spelling-error-in-doc-base-abstract-field",
                            join (' ', @$vals), "$dbfile:$line");
+            spelling_check_picky("spelling-error-in-doc-base-abstract-field",
+                                 join (' ', @$vals), "$dbfile:$line");
         }
     }
 }
@@ -651,4 +655,8 @@
 
 1;
 
+# Local Variables:
+# indent-tabs-mode: t
+# cperl-indent-level: 4
+# End:
 # vim: syntax=perl

Modified: trunk/checks/menus.desc
===================================================================
--- trunk/checks/menus.desc	2008-01-03 03:56:25 UTC (rev 1090)
+++ trunk/checks/menus.desc	2008-01-03 04:28:21 UTC (rev 1091)
@@ -264,16 +264,18 @@
 Ref: Debian doc-base Manual section 2.3.2
 
 Tag: spelling-error-in-doc-base-title-field
-Type: error
-Info: Lintian found a spelling error in the Title field of this doc-base
- control file.  Lintian has a list of common misspellings that it looks
- for.  It does not have a dictionary like a spelling checker does.
+Type: warning
+Info: Lintian found a spelling or capitalization error in the Title field
+ of this doc-base control file.  Lintian has a list of common misspellings
+ that it looks for.  It does not have a dictionary like a spelling checker
+ does.
 
 Tag: spelling-error-in-doc-base-abstract-field
-Type: error
-Info: Lintian found a spelling error in the Abstract field of this
- doc-base control file.  Lintian has a list of common misspellings that
- looks for.  It does not have a dictionary like a spelling checker does.
+Type: warning
+Info: Lintian found a spelling or capitalization error in the Abstract
+ field of this doc-base control file.  Lintian has a list of common
+ misspellings that looks for.  It does not have a dictionary like a
+ spelling checker does.
 
 Tag: doc-base-file-syntax-error
 Type: error

Modified: trunk/debian/changelog
===================================================================
--- trunk/debian/changelog	2008-01-03 03:56:25 UTC (rev 1090)
+++ trunk/debian/changelog	2008-01-03 04:28:21 UTC (rev 1091)
@@ -7,12 +7,19 @@
       particular about the exact formatting of the dh-make template.
       Triggering off the template text is enough and matches linda.
       Thanks, Joerg Jaspert.  (Closes: #458074)
+  * checks/description{.desc,}:
+    + [RA] Do picky spelling and capitalization checks on the description
+      and note and explain this in the long description.
   * checks/files.desc:
     + [RA] Remove a stray variable from the config-file-reserved tag.
   * checks/menu-format.desc:
     + [RA] Fix non-wm-module-in-wm-modules-menu-section pluralization to
       match the check and reword the long description to be hopefully
       clearer.  Thanks, Martín Ferrari.  (Closes: #457527)
+  * checks/menus{.desc,}:
+    + [RA] Spelling errors in doc-base files should only be warnings.  Do
+      picky spelling and capitalization checks on the abstract and title
+      fields.
   * checks/patch-systems:
     + [RA] dpatch permits multiple patches to be listed on the same line
       of 00list.  Patch by Chris Lamb.  (Closes: #457523)
@@ -34,6 +41,13 @@
     + [RA] Allow substvars instead of package names so that dependency
       checks against the source debian/control file don't treat all
       substvars as equivalent.  Thanks, Julien Cristau.  (Closes: #456802)
+  * lib/Spelling.pm:
+    + [RA] Stop doing capitalization checks on all files; there's too much
+      of a risk of false positives.  Instead, provide a separate picky
+      spelling check function for package descriptions and similar cases
+      where we're more sure of the contents.
+    + [RA] Expand the picky capitalization checks to catch Debian, GNOME,
+      KDE, and Linux.  (Closes: #456582)
 
   * reporting/html_reports:
     + [RA] Rewritten.

Modified: trunk/lib/Spelling.pm
===================================================================
--- trunk/lib/Spelling.pm	2008-01-03 03:56:25 UTC (rev 1090)
+++ trunk/lib/Spelling.pm	2008-01-03 04:28:21 UTC (rev 1091)
@@ -25,7 +25,7 @@
 
 use Exporter;
 our @ISA = qw(Exporter);
-our @EXPORT = qw(spelling_check);
+our @EXPORT = qw(spelling_check spelling_check_picky);
 
 # All spelling errors that have been observed "in the wild" in package
 # descriptions are added here, on the grounds that if they occurred once they
@@ -311,14 +311,19 @@
 # The format above doesn't allow spaces.
 $CORRECTIONS{'alot'} = 'a lot';
 
-# Corrections to apply before lowercasing the word.  Be careful about adding
-# things to this list, since currently there's no detection of literal text
-# and one might get false positives on, for example, configuration fragments
-# in README.Debian.
+# Picky corrections, applied before lowercasing the word.  These are only
+# applied to things known to be entirely English text, such as package
+# descriptions, and should not be applied to files that may contain
+# configuration fragments or more informal files such as debian/copyright.
 our %CORRECTIONS_CASE = qw(
+                           debian Debian
                            english English
                            french French
                            german German
+                           Gnome GNOME
+                           gnome GNOME
+                           kde KDE
+                           linux Linux
                            russian Russian
                           );
 
@@ -336,10 +341,6 @@
     my ($tag, $text, $filename) = @_;
 
     for my $word (split(/\s+/, $text)) {
-        if (exists $CORRECTIONS_CASE{$word}) {
-            _tag($tag, $filename, $word, $CORRECTIONS_CASE{$word});
-            next;
-        }
         $word = lc $word;
 
         # Try deleting the non-alphabetic parts from the word.  Treat
@@ -348,7 +349,7 @@
         #
         # FIXME: Should do something that's aware of Unicode character
         # classes rather than only handling ISO 8859-15 characters.
-        $word =~ s/(^\')|[^\w\xc0-\xd6\xd8-\xf6\xf8-\xff\']+|(\'$)//g;
+        $word =~ s/(^\')|[^\w\xc0-\xd6\xd8-\xf6\xf8-\xff\']+|(\'\z)//g;
         if (exists $CORRECTIONS{$word}) {
             _tag($tag, $filename, $word, $CORRECTIONS{$word});
         }
@@ -360,6 +361,24 @@
     }
 }
 
+# Check spelling of $text against pickier corrections, such as common
+# capitalization mistakes.  This check is separate from spelling_check since
+# it isn't appropriate for some files (such as changelog).  Takes $text to
+# check spelling in and $tag to report if we find anything.  $filename, if
+# included, is given as the first argument to the tag.  If it's not defined,
+# it will be omitted.
+sub spelling_check_picky {
+    my ($tag, $text, $filename) = @_;
+
+    for my $word (split(/\s+/, $text)) {
+        $word =~ s/(^\')|[\"().,?!:;]+|(\'\z)//g;
+        if (exists $CORRECTIONS_CASE{$word}) {
+            _tag($tag, $filename, $word, $CORRECTIONS_CASE{$word});
+            next;
+        }
+    }
+}
+
 1;
 
 # Local Variables:

Modified: trunk/testset/binary/debian/control
===================================================================
--- trunk/testset/binary/debian/control	2008-01-03 03:56:25 UTC (rev 1090)
+++ trunk/testset/binary/debian/control	2008-01-03 04:28:21 UTC (rev 1091)
@@ -14,7 +14,8 @@
 Homepage: <http://lintian.debian.org/>
 Vcs-Svn: http://svn.wolffelaar.nl/lintian/trunk
 Description: test handling of binary files
- Regression test for lintian's handling of binary files.
+ Regression test for lintian's handling of binary files for debian.  This
+ is checked for picky spelling errors.
  .
   Homepage: http://lintian.debian.org/
 

Modified: trunk/testset/binary/debian/copyright
===================================================================
--- trunk/testset/binary/debian/copyright	2008-01-03 03:56:25 UTC (rev 1090)
+++ trunk/testset/binary/debian/copyright	2008-01-03 04:28:21 UTC (rev 1091)
@@ -8,3 +8,5 @@
 Boston, MA 02111-1307, USA.
 
 Test for deprecated n�on��oding.
+
+Improper capitalization of linux or debian isn't caught here.

Modified: trunk/testset/binary/debian/doc-base
===================================================================
--- trunk/testset/binary/debian/doc-base	2008-01-03 03:56:25 UTC (rev 1090)
+++ trunk/testset/binary/debian/doc-base	2008-01-03 04:28:21 UTC (rev 1091)
@@ -1,5 +1,5 @@
 Document: binary!docs  
-Title: Broken binary doc-base control file
+Title: Broken debian binary doc-base control file
 Author: Russ Allbery
 Abstract: This control file exercises various tests of doc-base control
   files, including several things that aren't tested yet.  The third and

Modified: trunk/testset/tags.binary
===================================================================
--- trunk/testset/tags.binary	2008-01-03 03:56:25 UTC (rev 1090)
+++ trunk/testset/tags.binary	2008-01-03 04:28:21 UTC (rev 1091)
@@ -36,7 +36,6 @@
 E: binary: postinst-does-not-call-updatemenus usr/share/menu/binary
 E: binary: postrm-does-not-call-updatemenus usr/share/menu/binary
 E: binary: prerm-does-not-call-installdocs usr/share/doc-base/space 
-E: binary: spelling-error-in-doc-base-abstract-field binary:10 speling spelling
 E: binary: statically-linked-binary ./usr/bin/static-hello
 E: binary: su-wrapper-without--c /usr/lib/menu/binary:2 su-to-root
 E: binary: su-wrapper-without--c /usr/lib/menu/binary:3 sux
@@ -106,6 +105,9 @@
 W: binary: old-fsf-address-in-copyright-file
 W: binary: package-contains-hardlink usr/bar2 -> usr/share/baz
 W: binary: package-contains-upstream-install-documentation usr/share/doc/binary/INSTALL
+W: binary: spelling-error-in-description debian Debian
+W: binary: spelling-error-in-doc-base-abstract-field binary:10 speling spelling
+W: binary: spelling-error-in-doc-base-title-field binary:2 debian Debian
 W: binary: spelling-error-in-news-debian speling spelling
 W: binary: spelling-error-in-news-debian usefull useful
 W: binary: su-to-root-with-usr-sbin /usr/lib/menu/binary:4

Modified: trunk/testset/tags.manpages
===================================================================
--- trunk/testset/tags.manpages	2008-01-03 03:56:25 UTC (rev 1090)
+++ trunk/testset/tags.manpages	2008-01-03 04:28:21 UTC (rev 1091)
@@ -59,4 +59,3 @@
 W: manpages: manpage-has-bad-whatis-entry usr/share/man/man6/usr-games-binary.6.gz
 W: manpages: manpage-has-useless-whatis-entry usr/share/man/man1/true.1.gz
 W: manpages: package-contains-empty-directory usr/share/man/man1/not-a-man-page.1.gz/
-W: manpages: spelling-error-in-changelog english English


Reply to: