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

[lintian] 01/01: c/files: Warn about packages which ship coverage.py information



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

nthykier pushed a commit to branch master
in repository lintian.

commit a0943cd09d576e0bdfa8c866575d47c4adca35ea
Author: Chris Lamb <lamby@debian.org>
Date:   Tue Sep 6 22:36:54 2016 +0100

    c/files: Warn about packages which ship coverage.py information
    
    Closes: #831864
    Signed-off-by: Chris Lamb <lamby@debian.org>
    Signed-off-by: Niels Thykier <niels@thykier.net>
---
 checks/files.desc                                   | 12 ++++++++++++
 checks/files.pm                                     |  5 +++++
 debian/changelog                                    |  4 +++-
 t/tests/files-python-coverage/debian/.coverage      |  0
 t/tests/files-python-coverage/debian/debian/install |  1 +
 t/tests/files-python-coverage/desc                  |  6 ++++++
 t/tests/files-python-coverage/tags                  |  1 +
 7 files changed, 28 insertions(+), 1 deletion(-)

diff --git a/checks/files.desc b/checks/files.desc
index 5ddc26b..1400a5c 100644
--- a/checks/files.desc
+++ b/checks/files.desc
@@ -846,6 +846,18 @@ Info: Python eggs should not be installed, since the Debian package is
  .
  The egg may contain pre-compiled Python bytecode or shared libraries.
 
+Tag: package-contains-python-coverage-file
+Severity: normal
+Certainty: certain
+Info: The package conains a file that looks like output from the Python
+ coverage.py tool.  These are generated by python{,3}-coverage during a test
+ run, noting which parts of the code have been executed.  They can then be
+ subsequently analyzed to identify code that could have been executed but was
+ not.
+ .
+ As they are are unlikely to be of utility to end-users, these files should be
+ removed from the package.
+
 Tag: package-installs-python-pycache-dir
 Severity: serious
 Certainty: certain
diff --git a/checks/files.pm b/checks/files.pm
index b546cf9..f4f7579 100644
--- a/checks/files.pm
+++ b/checks/files.pm
@@ -1102,6 +1102,11 @@ sub run {
             tag 'package-installs-python-egg', $file;
         }
 
+        # ---------------- .coverage (coverage.py output)
+        if ($file->basename eq ".coverage") {
+            tag 'package-contains-python-coverage-file', $file;
+        }
+
         # ---------------- /usr/lib/site-python
         if ($fname =~ m,^usr/lib/site-python/\S,) {
             tag 'file-in-usr-lib-site-python', $file;
diff --git a/debian/changelog b/debian/changelog
index 2ce95ef..a0bcf5c 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -18,8 +18,10 @@ lintian (2.5.47) UNRELEASED; urgency=medium
   * checks/fields.{desc,pm}:
     + [JW] Fix typos.
     + [JW] Escape dots in some regexps.
-  * checks/files.desc:
+  * checks/files.{desc,pm}:
     + [JW] Fix typos.
+    + [NT] Apply patch from Chris Lamb to catch ".coverage" files in
+      packages.  (Closes: #831864)
   * checks/java.desc:
     + [JW] Fix typo.
   * checks/patch-systems.desc:
diff --git a/t/tests/files-python-coverage/debian/.coverage b/t/tests/files-python-coverage/debian/.coverage
new file mode 100644
index 0000000..e69de29
diff --git a/t/tests/files-python-coverage/debian/debian/install b/t/tests/files-python-coverage/debian/debian/install
new file mode 100644
index 0000000..3b6a0bc
--- /dev/null
+++ b/t/tests/files-python-coverage/debian/debian/install
@@ -0,0 +1 @@
+.coverage /usr/share/files-python-coverage
diff --git a/t/tests/files-python-coverage/desc b/t/tests/files-python-coverage/desc
new file mode 100644
index 0000000..67126e6
--- /dev/null
+++ b/t/tests/files-python-coverage/desc
@@ -0,0 +1,6 @@
+Testname: files-python-coverage
+Sequence: 6000
+Version: 1.0
+Description: Check for Python .coverage files
+Test-For:
+ package-contains-python-coverage-file
diff --git a/t/tests/files-python-coverage/tags b/t/tests/files-python-coverage/tags
new file mode 100644
index 0000000..c943f51
--- /dev/null
+++ b/t/tests/files-python-coverage/tags
@@ -0,0 +1 @@
+W: files-python-coverage: package-contains-python-coverage-file usr/share/files-python-coverage/.coverage

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


Reply to: