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

[PATCH] Check for empty paragraphs in extended description



---
 checks/description                                 |    2 +
 checks/description.desc                            |    6 +++
 debian/changelog                                   |    6 ++-
 debian/copyright                                   |    2 +
 .../debian/debian/control.in                       |   40 ++++++++++++++++++++
 t/tests/description-empty-paragraph/desc           |    5 ++
 t/tests/description-empty-paragraph/tags           |    2 +
 7 files changed, 62 insertions(+), 1 deletions(-)
 create mode 100644 t/tests/description-empty-paragraph/debian/debian/control.in
 create mode 100644 t/tests/description-empty-paragraph/desc
 create mode 100644 t/tests/description-empty-paragraph/tags

diff --git a/checks/description b/checks/description
index 30b1d30..2a08102 100644
--- a/checks/description
+++ b/checks/description
@@ -176,6 +176,8 @@ if ($type ne 'udeb') {
 	tag 'extended-description-is-empty';
     } elsif ($lines <= 2 and not $synopsis =~ /(dummy|transition)/i) {
 	tag 'extended-description-is-probably-too-short';
+    } elsif ($description =~ /^ \.\s*\n|\n \.\s*\n \.\s*\n|\n \.\s*\n?$/) {
+	tag 'extended-description-contains-empty-paragraph';
     }
 }
 
diff --git a/checks/description.desc b/checks/description.desc
index 2caf187..e8391d8 100644
--- a/checks/description.desc
+++ b/checks/description.desc
@@ -17,6 +17,12 @@ Severity: serious
 Certainty: certain
 Info: The first line in the "Description:" is empty.
 
+Tag: extended-description-contains-empty-paragraph
+Severity: normal
+Certainty: certain
+Info: The extended description (the lines after the first line of the
+ "Description:" field) contains an empty paragraph.
+
 Tag: extended-description-is-empty
 Severity: serious
 Certainty: certain
diff --git a/debian/changelog b/debian/changelog
index 5e5e927..779936d 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -4,6 +4,7 @@ lintian (2.5.0~rc4) UNRELEASED; urgency=low
     + Added:
       - duplicate-files
       - format-3.0-but-debian-changes-patch
+      - extended-description-contains-empty-paragraph
 
   * checks/copyright-file.desc:
     + [ADB] Correct a spelling mistake ("coypright" -> "copyright") in the
@@ -22,7 +23,10 @@ lintian (2.5.0~rc4) UNRELEASED; urgency=low
       file system root.  Thanks to Trent W. Buck for the bug report.
       (Closes: #624149)
 
- -- Adam D. Barratt <adam@adam-barratt.org.uk>  Sat, 23 Apr 2011 13:37:52 +0100
+  * checks/description{,.desc}:
+    + [RDI] Check for empty paragraphs in extended description.
+
+ -- Gerfried Fuchs <rhonda@debian.org>  Wed, 27 Apr 2011 00:56:09 +0200
 
 lintian (2.5.0~rc3) unstable; urgency=low
 
diff --git a/debian/copyright b/debian/copyright
index a60e0dd..2e526b5 100644
--- a/debian/copyright
+++ b/debian/copyright
@@ -20,6 +20,7 @@ in the changelog.  Key to frequent committers:
  JA  == Jari Aalto <jari.aalto@cante.net>
  RG  == Raphael Geissert <geissert@debian.org>
  NT  == Niels Thykier <niels@thykier.net>
+ RDI == Gerfried Fuchs <rhonda@debian.org>
 
 Contact address is <lintian-maint@debian.org>.
 
@@ -47,6 +48,7 @@ Portions Copyright (C) 2008-2010 Adam D. Barratt
 Portions Copyright (C) 2009 Stéphane Glondu
 Portions Copyright (C) 2010 Raphaël Hertzog
 Portions Copyright (C) 2010 Niels Thykier
+Portions Copyright (C) 2011 Gerfried Fuchs
 
 This program is free software; you may redistribute it and/or modify
 it under the terms of the GNU General Public License as published by
diff --git a/t/tests/description-empty-paragraph/debian/debian/control.in b/t/tests/description-empty-paragraph/debian/debian/control.in
new file mode 100644
index 0000000..05533ed
--- /dev/null
+++ b/t/tests/description-empty-paragraph/debian/debian/control.in
@@ -0,0 +1,40 @@
+Source: {$srcpkg}
+Priority: extra
+Section: {$section}
+Maintainer: {$author}
+Standards-Version: {$standards_version}
+Build-Depends: debhelper (>= 7)
+
+Package: {$srcpkg}
+Architecture: {$architecture}
+Depends: $\{shlibs:Depends\}, $\{misc:Depends\}
+Description: package to test empty first paragraph
+ .
+ The first paragraph
+ of this description
+ is empty. It is also an empty package.
+
+Package: {$srcpkg}-2
+Architecture: {$architecture}
+Depends: $\{shlibs:Depends\}, $\{misc:Depends\}
+Description: package to test empty last paragraph
+ The last paragraph
+ of this description
+ is empty. It is also an empty package.
+ .
+ Unfortunately this doesn't trigger the warning, an empty last paragraph
+ seems to get stripped out already before it is handed over.
+ .
+
+Package: {$srcpkg}-3
+Architecture: {$architecture}
+Depends: $\{shlibs:Depends\}, $\{misc:Depends\}
+Description: package to test empty paragraph in the middle
+ There is an
+ empty paragraph
+ in between. It is also an empty package.
+ .
+ .
+ There is an
+ empty paragraph
+ in between. It is also an empty package.
diff --git a/t/tests/description-empty-paragraph/desc b/t/tests/description-empty-paragraph/desc
new file mode 100644
index 0000000..279cd9b
--- /dev/null
+++ b/t/tests/description-empty-paragraph/desc
@@ -0,0 +1,5 @@
+Testname: description-empty-paragraph
+Sequence: 6000
+Version: 1.0
+Description: Tests of empty paragraphs in descriptions
+Test-For: extended-description-contains-empty-paragraph
diff --git a/t/tests/description-empty-paragraph/tags b/t/tests/description-empty-paragraph/tags
new file mode 100644
index 0000000..a57cb17
--- /dev/null
+++ b/t/tests/description-empty-paragraph/tags
@@ -0,0 +1,2 @@
+W: description-empty-paragraph-3: extended-description-contains-empty-paragraph
+W: description-empty-paragraph: extended-description-contains-empty-paragraph
-- 
1.7.4.4


Reply to: