Felix Lechner pushed to branch master at lintian / lintian


Commits:
9b8028c8 by Felix Lechner at 2022-01-23T10:58:27-08:00
For --info, pass in the required data object to avoid warning.

The author of this commit previously refactored this code only inaccurately.

Now avoids this warning:

➤ bin/lintian --info 
/mirror/debian/pool/main/p/python-nacl/python3-nacl_1.5.0-2_amd64.deb
N:
P: python3-nacl: experimental-to-unstable-without-comment 
[usr/share/doc/python3-nacl/changelog.Debian.gz:1]
Can't locate object method "explanation" via package 
"132" (perhaps you forgot to load "132"?) at 
/lcl/lechner/lintian/git/bin/../lib/Lintian/Output/EWI.pm line 428.

Gbp-Dch: ignore

- - - - -
72d1ee20 by Felix Lechner at 2022-01-23T11:48:35-08:00
Implement '--no-show-overrides'; honor it for overrides and masks 
alike. (See: #1004240)

Some folks, including the author of this commit, have 
"show-overrides=yes" in
their configuration files, but until now it was not possible to override that
setting on the command line.

Experimenting with the setting uncovered that it was not always honored. It is
also fixed here.

Turns this output

➤ bin/lintian --no-show-overrides 
/mirror/debian/pool/main/p/python-nacl/python3-nacl_1.5.0-2_amd64.deb
P: python3-nacl: experimental-to-unstable-without-comment 
[usr/share/doc/python3-nacl/changelog.Debian.gz:1]
N: masked by screen python/egg/metadata
M: python3-nacl: package-contains-documentation-outside-usr-share-doc 
[usr/lib/python3/dist-packages/PyNaCl-1.5.0.dist-info/top_level.txt]

into the more appropriate

➤ bin/lintian --no-show-overrides 
/mirror/debian/pool/main/p/python-nacl/python3-nacl_1.5.0-2_amd64.deb
P: python3-nacl: experimental-to-unstable-without-comment 
[usr/share/doc/python3-nacl/changelog.Debian.gz:1]

This commit was inspired by the upcoming fix for Bug#1004240. Thanks to Marc
Haber for bringing that matter to our attention!

- - - - -
78f4dcb5 by Felix Lechner at 2022-01-23T11:48:35-08:00
Allow the command-line option '--no-info' to reverse 'info=yes' 
in the configuration file. (Closes: #1004240)

With 'info=yes" in the configuration file, Lintian now produces this 
output:

➤ bin/lintian --no-info 
/mirror/debian/pool/main/p/python-nacl/python3-nacl_1.5.0-2_amd64.deb
P: python3-nacl: experimental-to-unstable-without-comment 
[usr/share/doc/python3-nacl/changelog.Debian.gz:1]
N: masked by screen python/egg/metadata
M: python3-nacl: package-contains-documentation-outside-usr-share-doc 
[usr/lib/python3/dist-packages/PyNaCl-1.5.0.dist-info/top_level.txt]

This commit also inspired the preceeding one for '--show-overides'. It
uncovered a bug and was therefore committed separately.

We furthermore made '--allow-root' reversible. Please let us know of any
additional command-line option that should be included, as well.

Thanks to Marc Haber for bringing the matter to our attention!

- - - - -


2 changed files:

- bin/lintian
- lib/Lintian/Output/EWI.pm


Changes:

=====================================
bin/lintian
=====================================
@@ -133,7 +133,7 @@ if (my $coverage_arg = $ENV{LINTIAN_COVERAGE}) {
 }
 
 my @getoptions = qw(
-  allow-root
+  allow-root!
   cfg=s
   check|c
   check-part|C=s@
@@ -153,7 +153,7 @@ my @getoptions = qw(
   hyperlinks=s
   ignore-lintian-env
   include-dir=s@
-  info|i
+  info|i!
   jobs|j=i
   no-cfg
   no-override|o
@@ -165,7 +165,7 @@ my @getoptions = qw(
   print-version
   profile=s
   quiet|q
-  show-overrides
+  show-overrides!
   status-log=s
   suppress-tags=s@
   suppress-tags-from-file=s
@@ -201,8 +201,12 @@ if (exists $command_line{'print-version'}) {
 show_help()
   if exists $command_line{help};
 
-$command_line{'show-overrides'} = 0
-  if exists $command_line{'hide-overrides'};
+if (exists $command_line{'hide-overrides'}) {
+    $command_line{'show-overrides'} = 0;
+    warn encode_utf8(
+"A future release will drop --hide-overrides; please use --no-show-overrides 
instead.\n"
+    );
+}
 
 $command_line{'tag-display-limit'} = 0
   if exists $command_line{'no-tag-display-limit'};


=====================================
lib/Lintian/Output/EWI.pm
=====================================
@@ -197,7 +197,10 @@ sub issue_hints {
                                 my $processable = $each->{processable};
 
                                 $self->print_hint($profile, $hint,
-                                    $processable,$option);
+                                    $processable,$option)
+                                  if ( !defined $hint->override
+                                    && !@{$hint->masks})
+                                  || $option->{'show-overrides'};
                             }
                         }
                     }
@@ -322,7 +325,8 @@ sub print_hint {
 
     if ($option->{info}) {
 
-        $self->describe_tag($tag, $option->{'output-width'})
+        # show only on first issuance
+        $self->describe_tag($profile->data, $tag, $option->{'output-width'})
           unless $self->issued_tag($tag->name);
     }
 



View it on GitLab: 
https://salsa.debian.org/lintian/lintian/-/compare/99e00d5b06d1076420745ac823f37d5a61880201...78f4dcb5101fd56724bd7d6873a805a2bbe32a16

-- 
View it on GitLab: 
https://salsa.debian.org/lintian/lintian/-/compare/99e00d5b06d1076420745ac823f37d5a61880201...78f4dcb5101fd56724bd7d6873a805a2bbe32a16
You're receiving this email because of your account on salsa.debian.org.


Reply via email to