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

[lintian] 01/01: [CL] Check for "FIXME" and similar placeholders in various files under debian/. (Closes: #846009)



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

lamby pushed a commit to branch master
in repository lintian.

commit 7319953bad3ae5e0e15f778a7ed19dd20241b77c
Author: Chris Lamb <lamby@debian.org>
Date:   Tue Jul 11 22:43:30 2017 +0100

    [CL] Check for "FIXME" and similar placeholders in various files under debian/. (Closes: #846009)
---
 checks/cruft.desc                                       | 10 ++++++++++
 checks/cruft.pm                                         | 10 ++++++++++
 debian/changelog                                        |  2 ++
 .../debian/debian/README.source                         |  5 +++++
 .../cruft-fixme-placeholders/debian/debian/control.in   | 17 +++++++++++++++++
 .../cruft-fixme-placeholders/debian/debian/copyright    |  8 ++++++++
 t/tests/cruft-fixme-placeholders/debian/debian/rules    |  5 +++++
 t/tests/cruft-fixme-placeholders/desc                   |  6 ++++++
 t/tests/cruft-fixme-placeholders/tags                   |  5 +++++
 9 files changed, 68 insertions(+)

diff --git a/checks/cruft.desc b/checks/cruft.desc
index d6ea92a..d0e1497 100644
--- a/checks/cruft.desc
+++ b/checks/cruft.desc
@@ -878,3 +878,13 @@ Info: Many modules packaged for the R Project for Statistical Computing contain
  debian/README.source, which this package is missing.
  .
  Please add a README.source documenting the origins of these files.
+
+Tag: file-contains-fixme-placeholder
+Severity: important
+Certainty: certain
+Info: This file appears to be incomplete or insufficiently modified as it
+ contains a "FIXME" placeholder text.  These can often be generated by
+ package generation tools such as dh_make or npm2deb.
+ .
+ Please double-check the file and replace the placeholder with the required
+ command or information.
diff --git a/checks/cruft.pm b/checks/cruft.pm
index 89ff57c..5ed8b53 100644
--- a/checks/cruft.pm
+++ b/checks/cruft.pm
@@ -707,6 +707,16 @@ sub find_cruft {
             }
         }
 
+        if (   $name =~ m{^debian/(README.source|copyright|rules|control)}
+            && $entry->is_file
+            && $entry->is_open_ok) {
+            my $fd = $entry->open;
+            while (my $line = <$fd>) {
+                next unless $line =~ m/(FIX_?ME)/;
+                tag 'file-contains-fixme-placeholder', "$name:$. $1";
+            }
+        }
+
         # Find mentioning of usr/lib/perl5 inside the packaging
         if ($name =~ m{^debian/}) {
             my $short = $entry->basename;
diff --git a/debian/changelog b/debian/changelog
index 2bd3e68..11d2122 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -18,6 +18,8 @@ lintian (2.5.52) UNRELEASED; urgency=medium
     + [CL] Move r-data-without-readme-source to check the source package,
       no the binary; the expected README.source files are not installed
       in binary packages. (Closes: #866322)
+    + [CL] Check for "FIXME" and similar placeholders in various files
+      under debian/. (Closes: #846009)
   * checks/fields.{desc,pm}:
     + [NT] Remove check for missing versioned build-depends for dpkg
       and debhlper when using Build-Profiles.  The necessary versions
diff --git a/t/tests/cruft-fixme-placeholders/debian/debian/README.source b/t/tests/cruft-fixme-placeholders/debian/debian/README.source
new file mode 100644
index 0000000..f4b7709
--- /dev/null
+++ b/t/tests/cruft-fixme-placeholders/debian/debian/README.source
@@ -0,0 +1,5 @@
+cruft-fixme-placeholders for Debian
+-----------------------------------
+
+FIXME: A reminder to do something
+FIX_ME: npm2deb uses underscores
diff --git a/t/tests/cruft-fixme-placeholders/debian/debian/control.in b/t/tests/cruft-fixme-placeholders/debian/debian/control.in
new file mode 100644
index 0000000..cc523ba
--- /dev/null
+++ b/t/tests/cruft-fixme-placeholders/debian/debian/control.in
@@ -0,0 +1,17 @@
+Source: {$source}
+Priority: extra
+Section: devel
+Maintainer: {$author}
+Standards-Version: {$standards_version}
+Build-Depends: {$build_depends}
+
+Package: {$source}
+Architecture: {$architecture}
+Depends: $\{shlibs:Depends\}, $\{misc:Depends\}
+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.
+ .
+ FIXME: This line should be detected by Lintian.
diff --git a/t/tests/cruft-fixme-placeholders/debian/debian/copyright b/t/tests/cruft-fixme-placeholders/debian/debian/copyright
new file mode 100644
index 0000000..6bb2c0e
--- /dev/null
+++ b/t/tests/cruft-fixme-placeholders/debian/debian/copyright
@@ -0,0 +1,8 @@
+This is part of the testsuite of lintian. See the file debian/copyright
+in the lintian source directory for more details.
+
+Insofar as this is copyrightable, it is:
+
+    Copyright 2017 Chris Lamb <lamby@debian.org>
+
+FIXME: Lintian should detect this text.
diff --git a/t/tests/cruft-fixme-placeholders/debian/debian/rules b/t/tests/cruft-fixme-placeholders/debian/debian/rules
new file mode 100644
index 0000000..975a857
--- /dev/null
+++ b/t/tests/cruft-fixme-placeholders/debian/debian/rules
@@ -0,0 +1,5 @@
+#!/usr/bin/make -f
+
+%:
+	# FIXME: Something
+	dh $@
diff --git a/t/tests/cruft-fixme-placeholders/desc b/t/tests/cruft-fixme-placeholders/desc
new file mode 100644
index 0000000..25c682d
--- /dev/null
+++ b/t/tests/cruft-fixme-placeholders/desc
@@ -0,0 +1,6 @@
+Testname: cruft-fixme-placeholders
+Sequence: 6000
+Version: 1.0
+Description: Check for placeholders in various maintainer scripts
+Test-For:
+ file-contains-fixme-placeholder
diff --git a/t/tests/cruft-fixme-placeholders/tags b/t/tests/cruft-fixme-placeholders/tags
new file mode 100644
index 0000000..4f9fb62
--- /dev/null
+++ b/t/tests/cruft-fixme-placeholders/tags
@@ -0,0 +1,5 @@
+E: cruft-fixme-placeholders source: file-contains-fixme-placeholder debian/README.source:4 FIXME
+E: cruft-fixme-placeholders source: file-contains-fixme-placeholder debian/README.source:5 FIX_ME
+E: cruft-fixme-placeholders source: file-contains-fixme-placeholder debian/control:17 FIXME
+E: cruft-fixme-placeholders source: file-contains-fixme-placeholder debian/copyright:8 FIXME
+E: cruft-fixme-placeholders source: file-contains-fixme-placeholder debian/rules:4 FIXME

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


Reply to: