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

[lintian] 01/02: Add a global exception list



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

broucaries-guest pushed a commit to branch master
in repository lintian.

commit 745fb495d66d936615c4d39363c41fbbcda63952
Author: Bastien ROUCARIÈS <roucaries.bastien@gmail.com>
Date:   Mon Dec 2 22:14:45 2013 +0100

    Add a global exception list
    
    Programming is correct but it fail spelling test due to suffix rule.
    
    Add a global exception list
---
 data/spelling/exceptions | 17 +++++++++++++++++
 debian/changelog         |  2 ++
 lib/Lintian/Check.pm     |  3 +++
 3 files changed, 22 insertions(+)

diff --git a/data/spelling/exceptions b/data/spelling/exceptions
new file mode 100644
index 0000000..6b8c216
--- /dev/null
+++ b/data/spelling/exceptions
@@ -0,0 +1,17 @@
+# All spelling false-positive that have been observed "in the wild" in package
+# descriptions are added here, on the grounds that if they occurred once they
+# are more likely to occur again.
+#
+# Be careful with corrections that involve punctuation, since the check is a
+# bit rough with punctuation.  For example, I had to delete the correction of
+# "builtin" to "built-in".
+#
+# The format of each line is:
+# exception
+#
+# Note that corrections involving multiple word mistakes or case errors
+# should be included in the appropriate data file, rather than here.
+#
+# Please use alpha sort
+process
+programming
\ No newline at end of file
diff --git a/debian/changelog b/debian/changelog
index 5a3090c..a87168e 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -40,6 +40,8 @@ lintian (2.5.20) UNRELEASED; urgency=low
   * lib/Lintian/Check.pm:
     + [RG] Detect a few more spelling mistakes by removing some
       suffixes before looking them up in the list of spelling mistakes.
+    + [BR] Add a list of global exception for spelling mistakes.
+      (Closes: #730715)
   * lib/Lintian/Collect/Package.pm:
     + [BR] Globally replace \\ by \ in _dequote_name(). This bug was
       masked by old buggy tar (Closes: #727665).
diff --git a/lib/Lintian/Check.pm b/lib/Lintian/Check.pm
index 6cf9153..eb4df6d 100644
--- a/lib/Lintian/Check.pm
+++ b/lib/Lintian/Check.pm
@@ -244,6 +244,7 @@ sub check_spelling {
     my $corrections = Lintian::Data->new('spelling/corrections', '\|\|');
     my $corrections_multiword
       = Lintian::Data->new('spelling/corrections-multiword', '\|\|');
+    my $global_exceptions = Lintian::Data->new('spelling/exceptions');
 
     $text =~ s/[()\[\]]//g;
     $text =~ s/(\w-)\s*\n\s*/$1/;
@@ -257,6 +258,8 @@ sub check_spelling {
         # Some exceptions are based on case (e.g. "teH").
         next if exists($exceptions->{$word});
         my $lcword = lc $word;
+        # global exception are case insentive
+        next if $global_exceptions->known($lcword);
         if ($corrections->known($lcword)
             &&!exists($exceptions->{$lcword})) {
             $correction = $corrections->value($lcword);

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


Reply to: