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

[lintian] 01/01: Warn about empty fields in debian/control. (Closes: #744388)



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

lamby pushed a commit to branch master
in repository lintian.

commit 37db1fbb44e7a2d13de0b4197dde4f0c8c1ca1ea
Author: Chris Lamb <lamby@debian.org>
Date:   Wed Oct 25 19:29:32 2017 -0400

    Warn about empty fields in debian/control. (Closes: #744388)
---
 checks/control-file.desc                              |  7 +++++++
 checks/control-file.pm                                |  2 ++
 debian/changelog                                      |  2 ++
 .../control-has-empty-field/debian/debian/control.in  | 19 +++++++++++++++++++
 t/tests/control-has-empty-field/desc                  |  6 ++++++
 t/tests/control-has-empty-field/tags                  |  1 +
 6 files changed, 37 insertions(+)

diff --git a/checks/control-file.desc b/checks/control-file.desc
index d2add23..6c7b1b1 100644
--- a/checks/control-file.desc
+++ b/checks/control-file.desc
@@ -306,3 +306,10 @@ Info: The package is a GObject Instrospection package but it does not specify a
  .
  This is usually an accidental omission and/or where the maintainer omits
  the <tt>--with=gir</tt> debhelper sequence.
+
+Tag: debian-control-has-empty-field
+Severity: pedantic
+Certainty: certain
+Info: The field on this line of <tt>debian/control</tt> is empty. Whilst
+ this is permitted in the syntax of Debian control files it is
+ unnecessary.
diff --git a/checks/control-file.pm b/checks/control-file.pm
index 831f5b3..7c6ea82 100644
--- a/checks/control-file.pm
+++ b/checks/control-file.pm
@@ -101,6 +101,8 @@ sub run {
             if ($field eq 'xc-package-type') {
                 tag 'xc-package-type-in-debian-control', "line $.";
             }
+            tag 'debian-control-has-empty-field', "$1 (line $.)"
+              if (/^(\S+):$/);
             unless (/^\S+: \S/ || /^\S+:$/) {
                 tag 'debian-control-has-unusual-field-spacing', "line $.";
             }
diff --git a/debian/changelog b/debian/changelog
index 9c5f0b1..55715c6 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -17,6 +17,8 @@ lintian (2.5.56) UNRELEASED; urgency=medium
       number of spelling mistakes.  (Closes: #878446)
     + [CL] Apply patch from Ville Skyttä <ville.skytta@iki.fi> to update
       a number of manual references.  (Closes: #878517)
+  * checks/control-file.{pm,desc}:
+    + [CL] Warn about empty fields in debian/control.  (Closes: #744388)
   * checks/cruft.{pm,desc}:
     + [CL] Warn about certain files under debian/* that contain trailing
       whitespace characters.  (Closes: #748405)
diff --git a/t/tests/control-has-empty-field/debian/debian/control.in b/t/tests/control-has-empty-field/debian/debian/control.in
new file mode 100644
index 0000000..f56f600
--- /dev/null
+++ b/t/tests/control-has-empty-field/debian/debian/control.in
@@ -0,0 +1,19 @@
+Source: {$source}
+Priority: optional
+Section: {$section}
+Maintainer: {$author}
+Standards-Version: {$standards_version}
+Build-Depends: {$build_depends}
+Rules-Requires-Root: binary-targets
+Homepage: https://lintian.debian.org/
+
+Package: {$source}
+Architecture: {$architecture}
+Depends: $\{shlibs:Depends\}, $\{misc:Depends\}
+Suggests:
+Recommends: $\{false:Positive\}
+Description: {$description}
+ This is a test package designed to exercise some feature or tag of
+ Lintian.  It is part of the Lintian test suite and may do very odd
+ things.  It should not be installed like a regular package.  It may
+ be an empty package.
diff --git a/t/tests/control-has-empty-field/desc b/t/tests/control-has-empty-field/desc
new file mode 100644
index 0000000..1a7d820
--- /dev/null
+++ b/t/tests/control-has-empty-field/desc
@@ -0,0 +1,6 @@
+Testname: control-has-empty-field
+Version: 1.0
+Options: -I -E --pedantic
+Description: Check for empty fields
+Test-For:
+ debian-control-has-empty-field
diff --git a/t/tests/control-has-empty-field/tags b/t/tests/control-has-empty-field/tags
new file mode 100644
index 0000000..3e3277d
--- /dev/null
+++ b/t/tests/control-has-empty-field/tags
@@ -0,0 +1 @@
+P: control-has-empty-field source: debian-control-has-empty-field Suggests (line 13)

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


Reply to: