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

lamby pushed a commit to branch master
in repository lintian.

commit e4099f0686381a039662da95b4173b28a073ada8
Author: Chris Lamb <la...@debian.org>
Date:   Fri Feb 9 11:37:19 2018 +0000

    Avoid false positives when checking for typos by ignoring files or patch 
descriptions that contain the words "typo" or "spelling". (Closes: #889964)
---
 checks/patch-systems.desc                               | 3 +++
 checks/patch-systems.pm                                 | 5 ++++-
 debian/changelog                                        | 5 +++++
 t/tests/spelling-general/debian/debian/patches/nonrel   | 6 ++++++
 t/tests/spelling-general/debian/debian/patches/series   | 2 ++
 t/tests/spelling-general/debian/debian/patches/spelling | 6 ++++++
 6 files changed, 26 insertions(+), 1 deletion(-)

diff --git a/checks/patch-systems.desc b/checks/patch-systems.desc
index 0f5b682..c131693 100644
--- a/checks/patch-systems.desc
+++ b/checks/patch-systems.desc
@@ -225,3 +225,6 @@ Certainty: certain
 Info: Lintian found a spelling or capitalization error in the description
  for this patch. Lintian has a list of common misspellings that it looks
  for. It does not have a dictionary like a spelling checker does.
+ .
+ Patch filenames or descriptions that refer to "spelling" or "typo" (or
+ similar) are ignored by Lintian.
diff --git a/checks/patch-systems.pm b/checks/patch-systems.pm
index a54e80f..32059a6 100644
--- a/checks/patch-systems.pm
+++ b/checks/patch-systems.pm
@@ -27,6 +27,8 @@ use autodie;
 use constant PATCH_DESC_TEMPLATE => 'TODO: Put a short summary on'
   . ' the line above and replace this paragraph';
 
+use List::MoreUtils qw(none);
+
 use Lintian::Check qw(check_spelling spelling_tag_emitter);
 use Lintian::Tags qw(tag);
 use Lintian::Util qw(internal_error strip);
@@ -283,7 +285,8 @@ sub check_patch {
       = spelling_tag_emitter('spelling-error-in-patch-description',
         $patch_file);
     check_spelling($description, $group->info->spelling_exceptions,
-        $tag_emitter);
+        $tag_emitter)
+      if none { /(spelling|typo)/i } ($patch_file, $description);
     # 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 dafa3d3..a549ab2 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -2,6 +2,11 @@ lintian (2.5.75) UNRELEASED; urgency=medium
 
   XXX: generate tag summary
 
+  * checks/patch-systems.{desc,pm}:
+    + [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)
+
  -- Chris Lamb <la...@debian.org>  Thu, 08 Feb 2018 18:00:44 +0000
 
 lintian (2.5.74) unstable; urgency=medium
diff --git a/t/tests/spelling-general/debian/debian/patches/nonrel 
b/t/tests/spelling-general/debian/debian/patches/nonrel
new file mode 100644
index 0000000..48e7740
--- /dev/null
+++ b/t/tests/spelling-general/debian/debian/patches/nonrel
@@ -0,0 +1,6 @@
+This is a deliberate speling error. (false positive; description mentions typo)
+
+--- upstream.orig/nonrel
++++ upstream/nonrel
+@@ -0,0 +1 @@
++Added by patch system.
diff --git a/t/tests/spelling-general/debian/debian/patches/series 
b/t/tests/spelling-general/debian/debian/patches/series
index 2804b8f..0bfb03d 100644
--- a/t/tests/spelling-general/debian/debian/patches/series
+++ b/t/tests/spelling-general/debian/debian/patches/series
@@ -1 +1,3 @@
 add-readme
+spelling
+nonrel
diff --git a/t/tests/spelling-general/debian/debian/patches/spelling 
b/t/tests/spelling-general/debian/debian/patches/spelling
new file mode 100644
index 0000000..29b9cfd
--- /dev/null
+++ b/t/tests/spelling-general/debian/debian/patches/spelling
@@ -0,0 +1,6 @@
+This is a deliberate speling error. (false positive; filename match)
+
+--- upstream.orig/spelling
++++ upstream/spelling
+@@ -0,0 +1 @@
++Added by patch system.

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

Reply via email to