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

[lintian] 01/01: lib/Lintian/Check.pm: Avoid false positives in the spelling-error-in-description (etc.) tags where the repetition is part of an acronym expansion such as "ORA (ORA Recursive Acronym)". (Closes: #883719)



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

lamby pushed a commit to branch master
in repository lintian.

commit 3a514f01f6eb4796a7802ad5fc8802c16f099d23
Author: Chris Lamb <lamby@debian.org>
Date:   Fri Jan 26 15:11:05 2018 +1100

    lib/Lintian/Check.pm: Avoid false positives in the spelling-error-in-description (etc.) tags where the repetition is part of an acronym expansion such as "ORA (ORA Recursive Acronym)". (Closes: #883719)
---
 debian/changelog                                     | 5 +++++
 lib/Lintian/Check.pm                                 | 4 +++-
 t/tests/description-general/debian/debian/control.in | 2 ++
 3 files changed, 10 insertions(+), 1 deletion(-)

diff --git a/debian/changelog b/debian/changelog
index a667d1a..29672df 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -56,6 +56,11 @@ lintian (2.5.72) UNRELEASED; urgency=medium
     + [CL] Add missing initials for Gergely Nagy, Sylvestre Ledru and Steve
       Langasek.  (Closes: #831729)
 
+  * lib/Lintian/Check.pm:
+    + [CL] Avoid false positives in the spelling-error-in-description
+      (etc.) tags where the repetition is part of an acronym expansion such
+      as "ORA (ORA Recursive Acronym)".  (Closes: #883719)
+
  -- Chris Lamb <lamby@debian.org>  Sun, 21 Jan 2018 16:42:25 +1100
 
 lintian (2.5.71) unstable; urgency=medium
diff --git a/lib/Lintian/Check.pm b/lib/Lintian/Check.pm
index 4d5d52b..e553007 100644
--- a/lib/Lintian/Check.pm
+++ b/lib/Lintian/Check.pm
@@ -269,6 +269,7 @@ sub check_spelling {
 
     my (%seen, %duplicates, $last_word, $quoted);
     my $counter = 0;
+    my $text_orig = $text;
 
     if (!%CORRECTIONS) {
         my $corrections_multiword
@@ -304,7 +305,8 @@ sub check_spelling {
             $code_ref->("$word $word (duplicate word)", $word)
               if not $quoted
               and not $duplicates{$word}++
-              and not $ends_with_punct;
+              and not $ends_with_punct
+              and $text_orig !~ /\b$word\s*\($word\b/;
         }
 
         if ($word =~ m/^[A-Za-z]+$/ and not $ends_with_punct) {
diff --git a/t/tests/description-general/debian/debian/control.in b/t/tests/description-general/debian/debian/control.in
index 6d08445..28f1278 100644
--- a/t/tests/description-general/debian/debian/control.in
+++ b/t/tests/description-general/debian/debian/control.in
@@ -155,3 +155,5 @@ Description: test for spelling - debian developement
  Some more stuff about this Debian test package. (dummy)
  .
  Duplicate: Duplicate (false positive due to colon)
+ .
+ FOO (FOO Owsome Object) is a recursive acronym.

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


Reply to: