Commit 111da964 authored by Chris Lamb's avatar Chris Lamb

Warn about packages that use an excessive number of debhelper overrides.

parent e6c8a48b
Pipeline #19989 failed with stage
in 0 seconds
......@@ -472,3 +472,22 @@ Info: This package does not appear to use a build system helper such as
distribution-wide changes to packages and reduce the "bus factor" &
barriers to entry from external contributors.
Ref: debhelper(7), dh(1), https://build-common.alioth.debian.org/
Tag: excessive-debhelper-overrides
Severity: normal
Certainty: possible
Info: The <tt>debian/rules</tt> file appears to include a suspiciously
high number of <tt>dh_override_</tt>-style overrides.
.
It is likely that is this was intended to optimise package builds by
introducing "no-op" overrides that avoid specific debhelper commands.
.
However, whilst using overrides are not a problem per-se, such a list
is usually a premature optimisation, subject to constant revision,
prevents future debhelper versions fixing archive-wide problems, adds
unnecessary noise/distraction for anyone reviewing the package,
increases the package's "bus factor" and is typically a premature
optimisation. It is, in addition, aesthetically displeasing.
.
Please remove the unnecessary overrides.
Ref: debhelper(7), dh(1)
......@@ -355,6 +355,10 @@ sub run {
if $line and $level >= 11;
}
my $num_overrides = scalar(%overrides);
tag 'excessive-debhelper-overrides', $num_overrides
if $num_overrides >= 20;
tag 'debian-rules-uses-unnecessary-dh-argument', 'dh ... --parallel',
"(line $seen_dh_parallel)"
if $seen_dh_parallel and $level >= 10;
......
......@@ -2,6 +2,9 @@ lintian (2.5.106) UNRELEASED; urgency=medium
XXX: generate tag summary
* checks/debhelper.{desc,pm}:
+ [CL] Warn about packages that use an excessive number of debhelper
overrides.
* checks/files.{desc,pm}:
+ [CL] Apply a patch from Josh Triplett to check for packages that
install APT keyrings without being called "foo-archive-keyring" or
......
#!/usr/bin/make -f
%:
dh $@
# Commands not to run
override_dh_installcatalogs:
override_dh_installemacsen override_dh_installifupdown:
override_dh_installinfo override_dh_installmenu override_dh_installmime:
override_dh_installmodules override_dh_installlogcheck:
override_dh_installpam override_dh_installppp override_dh_installudev override_dh_installwm:
override_dh_installxfonts override_dh_gconf override_dh_icons override_dh_perl override_dh_usrlocal:
override_dh_installcron override_dh_installdebconf:
override_dh_installlogrotate override_dh_installgsettings:
Testname: debhelper-excessive-overrides
Version: 1.0
Description: Test for excessive number of overrides
Test-For:
excessive-debhelper-overrides
W: debhelper-excessive-overrides source: excessive-debhelper-overrides 21
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment