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

[lintian] 02/02: Check the first line of the description separately for spelling errors to avoid false-positive duplicate checks across a patch description's synopsis and its body. (Closes: #890100)



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

lamby pushed a commit to branch master
in repository lintian.

commit d43166c7db7ec8952e741775bbca97ee743fb5f3
Author: Chris Lamb <lamby@debian.org>
Date:   Sun Feb 11 10:54:08 2018 +0000

    Check the first line of the description separately for spelling errors to avoid false-positive duplicate checks across a patch description's synopsis and its body. (Closes: #890100)
---
 checks/patch-systems.pm                                   | 15 +++++++++------
 debian/changelog                                          |  3 +++
 t/tests/spelling-general/debian/debian/patches/add-readme |  4 +++-
 3 files changed, 15 insertions(+), 7 deletions(-)

diff --git a/checks/patch-systems.pm b/checks/patch-systems.pm
index 32059a6..06e1eae 100644
--- a/checks/patch-systems.pm
+++ b/checks/patch-systems.pm
@@ -281,12 +281,15 @@ sub run {
 # Checks on patches common to all build systems.
 sub check_patch {
     my ($group, $patch_file, $description) = @_;
-    my $tag_emitter
-      = spelling_tag_emitter('spelling-error-in-patch-description',
-        $patch_file);
-    check_spelling($description, $group->info->spelling_exceptions,
-        $tag_emitter)
-      if none { /(spelling|typo)/i } ($patch_file, $description);
+    if (none { /(spelling|typo)/i } ($patch_file, $description)) {
+        my $tag_emitter
+          = spelling_tag_emitter('spelling-error-in-patch-description',
+            $patch_file);
+        # Check the first line seperately to avoid duplicates
+        foreach my $x (split(/\n/, $description, 2)) {
+            check_spelling($x, $group->info->spelling_exceptions,$tag_emitter);
+        }
+    }
     # Use --strip=1 to strip off the first layer of directory in case
     # the parent directory in which the patches were generated was
     # named "debian".  This will produce false negatives for --strip=0
diff --git a/debian/changelog b/debian/changelog
index b4e69db..e614910 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -9,6 +9,9 @@ lintian (2.5.75) UNRELEASED; urgency=medium
     + [CL] Avoid false positives when checking for typos by ignoring files
       or patch descriptions that contain the words "typo" or "spelling".
       Thanks to Bas Couwenberg for the report.  (Closes: #889964)
+    + [CL] Check the first line of the description separately for spelling
+      errors to avoid false-positive duplicate checks across a patch
+      description's synopsis and its body.  (Closes: #890100)
   * checks/python.desc:
     + [CL] Underline that maintainers do not need to override the
       new-package-should-not-package-python2-module tag but rather leave a
diff --git a/t/tests/spelling-general/debian/debian/patches/add-readme b/t/tests/spelling-general/debian/debian/patches/add-readme
index 78eb203..b1647ba 100644
--- a/t/tests/spelling-general/debian/debian/patches/add-readme
+++ b/t/tests/spelling-general/debian/debian/patches/add-readme
@@ -1,4 +1,6 @@
-This is a deliberate speling error.
+This is a deliberate speling error. duplicate
+
+duplicate
 
 --- upstream.orig/README
 +++ upstream/README

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


Reply to: