Bastien Roucariès pushed to branch master at lintian / lintian


Commits:
84030380 by Andrius Merkys at 2025-08-20T22:47:39+00:00
In files/source-missing check, look for longest lines only in JavaScript and 
HTML files

- - - - -


1 changed file:

- lib/Lintian/Check/Files/SourceMissing.pm


Changes:

=====================================
lib/Lintian/Check/Files/SourceMissing.pm
=====================================
@@ -44,6 +44,8 @@ const my $DOLLAR => q{$};
 const my $DOT => q{.};
 const my $DOUBLE_DOT => q{..};
 const my $ITEM_NOT_FOUND => -1;
+const my $JS_SUFFIX => qr/\.js$/;
+const my $HTML_SUFFIX => qr/\.(?:x?html?\d?|xht)$/;
 
 use Moo;
 use namespace::clean;
@@ -147,6 +149,10 @@ sub visit_patched_files {
         return;
     }
 
+    return
+      unless $item->basename =~ /$JS_SUFFIX/i
+      || $item->basename =~ /$HTML_SUFFIX/i;
+
     my @lines = split(/\n/, $item->bytes);
 
     my $longest;
@@ -164,7 +170,7 @@ sub visit_patched_files {
     return
       if !defined $longest || $length <= $VERY_LONG_LINE_LENGTH;
 
-    if ($item->basename =~ m{\.js$}i) {
+    if ($item->basename =~ /$JS_SUFFIX/i) {
 
         $self->pointed_hint('source-contains-prebuilt-javascript-object',
             $item->pointer);
@@ -182,7 +188,7 @@ sub visit_patched_files {
           );
     }
 
-    if ($item->basename =~ /\.(?:x?html?\d?|xht)$/i) {
+    if ($item->basename =~ /$HTML_SUFFIX/i) {
 
         # html file
         $self->pointed_hint('source-is-missing', $item->pointer)



View it on GitLab: 
https://salsa.debian.org/lintian/lintian/-/commit/8403038043e3d18c00f7f7eb497da3576fe6e6ff

-- 
View it on GitLab: 
https://salsa.debian.org/lintian/lintian/-/commit/8403038043e3d18c00f7f7eb497da3576fe6e6ff
You're receiving this email because of your account on salsa.debian.org.


Reply via email to