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

[lintian] 01/02: Split out python-module-has-overly-generic-name regular expression into a data file.



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

lamby pushed a commit to branch master
in repository lintian.

commit 60b69ebdafd1d8186f4b9325a9abe515ce07a5fb
Author: Chris Lamb <lamby@debian.org>
Date:   Thu Dec 28 22:32:55 2017 +0000

    Split out python-module-has-overly-generic-name regular expression into a data file.
---
 checks/files.pm                   | 7 ++++---
 data/files/python-generic-modules | 5 +++++
 debian/changelog                  | 3 +++
 3 files changed, 12 insertions(+), 3 deletions(-)

diff --git a/checks/files.pm b/checks/files.pm
index 051a82f..d969a13 100644
--- a/checks/files.pm
+++ b/checks/files.pm
@@ -38,6 +38,7 @@ my $LOCALE_CODES = Lintian::Data->new('files/locale-codes', qr/\s++/);
 my $INCORRECT_LOCALE_CODES
   = Lintian::Data->new('files/incorrect-locale-codes', qr/\s++/);
 my $MULTIARCH_DIRS = Lintian::Data->new('common/multiarch-dirs', qr/\s++/);
+my $GENERIC_PYTHON_MODULES = Lintian::Data->new('files/python-generic-modules');
 
 my $PRIVACY_BREAKER_WEBSITES= Lintian::Data->new(
     'files/privacy-breaker-websites',
@@ -1415,9 +1416,9 @@ sub run {
             }
             tag 'python-module-in-wrong-location', @correction
               if (@correction);
-            if (    $rest =~ m,^(docs?|site|tests?)s?(?:\.py|/__init__\.py)$,
-                and $file->is_regular_file) {
-                tag 'python-module-has-overly-generic-name', $fname, "($1)";
+            for my $regex ($GENERIC_PYTHON_MODULES->all) {
+                tag 'python-module-has-overly-generic-name', $fname, "($1)"
+                    if $rest =~ m,^($regex)(?:\.py|/__init__\.py)$,i
             }
         }
 
diff --git a/data/files/python-generic-modules b/data/files/python-generic-modules
new file mode 100644
index 0000000..58bc070
--- /dev/null
+++ b/data/files/python-generic-modules
@@ -0,0 +1,5 @@
+# Regular expressions (/i) of overly-generic Python module names.
+
+docs?
+site
+tests?
diff --git a/debian/changelog b/debian/changelog
index 0f0e096..13344f3 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -5,6 +5,9 @@ lintian (2.5.67) UNRELEASED; urgency=medium
   * checks/changelog-file.{desc,pm}:
     + [CL] Warn about changelog entries that have incorrectly formatted
       dates.  (Closes: #793406)
+  * checks/files.pm:
+    + [CL] Split out python-module-has-overly-generic-name regular
+      expression into a data file.
   * checks/watch-file.{desc,pm}:
     + [CL] Apply patch from Felix Lechner <felix.lechner@lease-up.com> to
       check for packages where an upstream signature exists but is not

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


Reply to: