[libconfig-model-dpkg-perl] 05/13: scanner: accepted are added to licensecheck's list

dod at debian.org dod at debian.org
Sun Feb 7 17:16:16 UTC 2016


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

dod pushed a commit to branch master
in repository libconfig-model-dpkg-perl.

commit 045f9d329282fa55caa35a388082ca9e2b1cb405
Author: Dominique Dumont <dod at debian.org>
Date:   Sun Feb 7 15:53:18 2016 +0100

    scanner: accepted are added to licensecheck's list
---
 lib/Dpkg/Copyright/Scanner.pm | 53 ++++++++++++++++++++++++++++++++++++-------
 1 file changed, 45 insertions(+), 8 deletions(-)

diff --git a/lib/Dpkg/Copyright/Scanner.pm b/lib/Dpkg/Copyright/Scanner.pm
index d34b691..4af2596 100644
--- a/lib/Dpkg/Copyright/Scanner.pm
+++ b/lib/Dpkg/Copyright/Scanner.pm
@@ -90,8 +90,9 @@ sub _warn ($msg) {
     warn $msg unless $quiet;
 }
 
+my %default ;
 # from licensecheck.pl
-my $default_ignore_regex = qr!
+$default{ignore}= qr!
 # Ignore general backup files
 ~$|
 # Ignore emacs recovery files
@@ -107,9 +108,46 @@ my $default_ignore_regex = qr!
 \.shelf|_MTN|\.bzr(?:\.backup|tags)?)(?:$|/.*$)
 !x;
 
+# also from licensecheck
+$default{check} =
+    qr!
+    \.(                          # search for file suffix
+        c(c|pp|xx)?              # c and c++
+       |h(h|pp|xx)?              # header files for c and c++
+       |S
+       |css|less                 # HTML css and similar
+       |f(77|90)?
+       |go
+       |groovy
+       |lisp
+       |scala
+       |clj
+       |p(l|m)?6?|t|xs|pod6?     # perl5 or perl6
+       |sh
+       |php
+       |py(|x)
+       |rb
+       |java
+       |js
+       |vala
+       |el
+       |sc(i|e)
+       |cs
+       |pas
+       |inc
+       |dtd|xsl
+       |mod
+       |m
+       |md|markdown
+       |tex
+       |mli?
+       |(c|l)?hs
+     )
+    $
+   !x;
+
 # cleanup the regexp
-$default_ignore_regex =~ s/#.*\n//g;
-$default_ignore_regex =~ s/\n//g;
+map { s/#.*\n//g;  s/\n//g; } values %default;
 
 # option to skip UNKNOWN ?
 # load a file to override some entries ?
@@ -139,8 +177,7 @@ sub scan_files ( %args ) {
             my @opts = ();
             foreach my $what (qw/check ignore/) {
                 my $data = $scan_data->{$what} or next;
-                my $reg = join( '|' , (map { '\.'.$_.'$'} @{$data->{suffixes} || []}), @{ $data->{pattern} || []});
-                $reg .= '|' .$default_ignore_regex if $what eq 'ignore';
+                my $reg = join( '|' , (map { '\.'.$_.'$'} @{$data->{suffixes} || []}), @{ $data->{pattern} || []}, $default{$what});
                 push @opts, '--skipped', "--$what=$reg";
             }
             @runs = \@opts ;
@@ -580,9 +617,9 @@ the list of files.
 
 By default, the decision whether to scan a file or not is left to L<licensecheck>.
 
-You can override this behavior in file
+You can change this behavior in file
 C<debian/copyright-scan-patterns.yml>. This YAML file can
-contain a list of suffixes or patterns to scan or to ignore. Any file
+contain a list of suffixes or patterns to scan or to ignore that are added to licensecheck's list. Any file
 that is not scanned or ignored will be shown as "skipped".
 
 The file must have the following structure (all fields are optional
@@ -592,7 +629,7 @@ and order does not matter):
  check :
    suffixes :
      - PL       # check .PL$
-     - pl
+     - asm
    pattern:
      - /README$
  ignore :

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-perl/packages/libconfig-model-dpkg-perl.git



More information about the Pkg-perl-cvs-commits mailing list