It would be great if there was a way to list all lintian tags excluding classifications; perhaps something like "explain-lintian-tags -l --severity=warning,pedantic". This would be useful in lintian-brush to track when new lintian tags get introduced that might warrant a relevant fixer in lintian-brush. (At the moment, classification tags are excluded manually)
Hi Jelmer, I'll think of a good way to address your issue, but wanted to cue you in that classification tags are on the way out. Lintian is being split into two parts (internally). One provides scanning (similar to lab results in medicine) and the other provides the evaluation (like a doctor's diagnosis). Classification tags are scanning results and have nothing to do with the diagnosis. Direct access to Lintian's scanning results, which will be provided in ever greater numbers, should be very useful to many automated tools in the Debian ecosystem, such as Lucas's Trends, and perhaps even to the Janitor. An example for this new direction is the tag trimmed-field. Kind regards Felix Lechner
Hi Jelmer,
Despite some reflection I'm not keen on expanding what I think is a
flawed interface. At the same time, I do not wish to stand in the
Janitor's way. Could you perhaps use the JSON interface of that
command, and filter yourself? Here is some code that should do more or
less what you require:
use IPC::Run3;
use JSON::MaybeXS;
my $list_out;
my @command = qw{/usr/bin/lintian-explain-tags --format json};
run3(\@command, undef, \$list_out);
my $definitions = decode_json($list_out);
my @sorted = sort { lc($a->{Name}) cmp lc($b->{Name}) } @{$definitions};
my @errors = grep { $_{visibility} eq 'error' } @sorted;
my @warnings = grep { $_{visibility} eq 'warning' } @sorted;
In the future, you will also be able to use your code on this URL:
https://lintian.debian.org/query/tags (returns JSON)
Kind regards
Felix Lechner