Bug#756643: lintian: Short description with a single word should trigger a warning
Package: lintian
Version: 2.5.25
Severity: normal
Hello,
Watching this package:
https://packages.debian.org/sid/libxmltooling-java
I noticed that the short description is just "XMLTooling-J"
which is not very helpful.
The attached patch adds a check when the short description is only
one word long.
Thanks,
Sylvestre
-- System Information:
Debian Release: jessie/sid
APT prefers testing
APT policy: (900, 'testing'), (600, 'unstable'), (500, 'testing-updates')
Architecture: amd64 (x86_64)
Foreign Architectures: i386
Kernel: Linux 3.14-1-amd64 (SMP w/8 CPU cores)
Locale: LANG=fr_FR.UTF-8, LC_CTYPE=fr_FR.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Versions of packages lintian depends on:
ii binutils 2.24.51.20140709-1
ii bzip2 1.0.6-5
ii diffstat 1.58-1
ii file 1:5.19-1
ii gettext 0.18.3.2-4
ii hardening-includes 2.5
ii intltool-debian 0.35.0+20060710.1
ii libapt-pkg-perl 0.1.29+b1
ii libarchive-zip-perl 1.37-2
ii libclass-accessor-perl 0.34-1
ii libclone-perl 0.37-1
ii libdpkg-perl 1.17.10
ii libemail-valid-perl 1.194-1
ii libfile-basedir-perl 0.03-1
ii libipc-run-perl 0.92-1
ii liblist-moreutils-perl 0.33-2
ii libparse-debianchangelog-perl 1.2.0-1
ii libtext-levenshtein-perl 0.09-1
ii libtimedate-perl 2.3000-2
ii liburi-perl 1.62-1
ii man-db 2.6.7.1-1
ii patchutils 0.3.3-1
ii perl [libdigest-sha-perl] 5.18.2-6
ii t1utils 1.37-2
Versions of packages lintian recommends:
pn libperlio-gzip-perl <none>
ii perl-modules [libautodie-perl] 5.18.2-6
Versions of packages lintian suggests:
pn binutils-multiarch <none>
ii dpkg-dev 1.17.10
ii libhtml-parser-perl 3.71-1+b1
ii libtext-template-perl 1.46-1
ii libyaml-perl 0.95-1
ii xz-utils 5.1.1alpha+20120614-2
-- no debconf information
>From ff68ca6e9729732ee58746e19235c16c31465567 Mon Sep 17 00:00:00 2001
From: Sylvestre Ledru <sylvestre@debian.org>
Date: Thu, 31 Jul 2014 15:53:48 +0200
Subject: [PATCH] * checks/description.{desc,pm}: + [SL] Check for one word
short description.
---
checks/description.desc | 7 +++++++
checks/description.pm | 4 ++++
debian/changelog | 2 ++
t/tests/description-general/debian/debian/control.in | 9 +++++++++
t/tests/description-general/desc | 1 +
t/tests/description-general/tags | 1 +
6 files changed, 24 insertions(+)
diff --git a/checks/description.desc b/checks/description.desc
index 890e5bf..8753436 100644
--- a/checks/description.desc
+++ b/checks/description.desc
@@ -31,6 +31,13 @@ Info: The extended description (the lines after the first line of the
"Description:" field) is empty.
Ref: policy 3.4
+Tag: description-too-short
+Severity: serious
+Certainty: certain
+Ref: devref 6.2.2
+Info: The description contains only a single word. It is likely that the
+ description won't be very clear for the user.
+
Tag: extended-description-is-probably-too-short
Severity: minor
Certainty: possible
diff --git a/checks/description.pm b/checks/description.pm
index fca1498..8d61878 100644
--- a/checks/description.pm
+++ b/checks/description.pm
@@ -40,6 +40,7 @@ sub run {
my $unindented_list = 0;
my $synopsis;
my $description;
+ my $wordcount;
# description?
my $full_description = $info->field('description');
@@ -77,6 +78,9 @@ sub run {
} elsif ($synopsis =~ m/<insert up to 60 chars description>/) {
tag 'description-is-dh_make-template' unless $template++;
}
+ if (($wordcount = $synopsis =~ s/((^|\s)\S)/$1/g) == 1) {
+ tag 'description-too-short';
+ }
# We have to decode into UTF-8 to get the right length for the
# length check. If the changelog uses a non-UTF-8 encoding,
diff --git a/debian/changelog b/debian/changelog
index ad8b029..b435edf 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -31,6 +31,8 @@ lintian (2.5.26) UNRELEASED; urgency=medium
+ [BR] Detect undefined license. (Closes: #733659).
* checks/testsuite.desc:
+ [BR] Update ref url. (Closes: #755275).
+ * checks/description.{desc,pm}:
+ + [SL] Check for one word short description.
* data/cruft/warn-file-type:
+ [BR] Add debug source suffix for detecting javascript
diff --git a/t/tests/description-general/debian/debian/control.in b/t/tests/description-general/debian/debian/control.in
index 6fa6204..bbc6986 100644
--- a/t/tests/description-general/debian/debian/control.in
+++ b/t/tests/description-general/debian/debian/control.in
@@ -66,6 +66,15 @@ Description: This description ends, etc.
things. It should not be installed like a regular package. It may
be an empty package.
+Package: {$source}-short
+Architecture: {$architecture}
+Depends: $\{shlibs:Depends\}, $\{misc:Depends\}
+Description: Short
+ The description is too short. One word is not enough.
+ Second line to avoid the warning.
+ .
+ And a third. (dummy)
+
Package: {$source}-dummy
Section: oldlibs
Architecture: {$architecture}
diff --git a/t/tests/description-general/desc b/t/tests/description-general/desc
index b1bbcea..9be1b4f 100644
--- a/t/tests/description-general/desc
+++ b/t/tests/description-general/desc
@@ -18,6 +18,7 @@ Test-For:
description-synopsis-might-not-be-phrased-properly
description-synopsis-starts-with-article
description-too-long
+ description-too-short
extended-description-is-empty
extended-description-line-too-long
possible-unindented-list-in-extended-description
diff --git a/t/tests/description-general/tags b/t/tests/description-general/tags
index 9a5621c..321c314 100644
--- a/t/tests/description-general/tags
+++ b/t/tests/description-general/tags
@@ -2,6 +2,7 @@ E: description-general-2: description-contains-tabs
E: description-general-3: description-synopsis-is-empty
E: description-general-4: description-synopsis-is-duplicated
E: description-general-empty: extended-description-is-empty
+E: description-general-short: description-too-short
E: description-general: description-contains-invalid-control-statement
E: description-general: description-contains-tabs
E: description-general: description-is-debmake-template
--
2.0.1
Reply to: