[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Restructuring check scripts



Hi everyone,

I doubt I'm the only one who dislikes the way check scripts keep on getting
bigger and bigger, with all the code in one huge run() method.

I'd like to propose making all the check scripts inherit a Lintian::Checks
(not to be confused with the existing Lintian::Check) module that would
take care of setting up some common bits and provide a run() method that
would in turn examine the symbols table of the module and run all the
methods matching a given pattern (say m/^check_/.)

The idea is to make it easy to split the code of the checks scripts.

Although it might not directly allow much splitting, it is the base idea and
it can be improved.

On another different but not too distant topic, I'd like to propose adding
per-tag needs-info. Of course a global needs-info would still be allowed to
declare collection scripts needed by most/all the tags.
The idea is to later introduce an easy-to-use method to Tags that would
allow a check script to know whether a given tag would ever be printed. If
it is never going to be printed, why care about processing some data? why
care to collect unused information?
A perfect example for this is spelling-error-in-binary, which needs -I
and -E to be displayed. If the tag would never be displayed, and it is the
only one requiring the 'strings' collection script (oops, it ain't the best
example after all, since we now have embedded-zlib) then that collection
script is not run and therefore the check script doesn't spend time on it
(which is the only benefit it would gain in this case.)

Comments?

If you think that I will later propose using threads I'd tell you you are
reading my mind, but since perl's threads implementation is not suitable
for small tasks forget about it, for now.

Cheers,
-- 
Raphael Geissert - Debian Maintainer
www.debian.org - get.debian.net



Reply to: