Bug#704197: Please review: systemd checks
Michael Stapelberg <stapelberg@debian.org> writes:
> Niels Thykier <niels@thykier.net> writes:
>> guidelines. I know Lintian's code style is a mess in general, so it
>> describes the style I hope we will eventually reach[1]. :)
> Have you tried using perltidy for Lintian? I loathe manual source code
> formatting after working with gofmt and subsequently perltidy.
I desperately need to update the page that Niels is looking at to
incorporate the results of a very comprehensive style review we did at
Stanford with reference to Perl Best Practices, as it's changed a lot. We
have a new house style that's similar but incorporates a ton of advice
from Perl Best Practices, and I have both perlcritic and perltidy
configurations that correspond to it (as closely as one can, at least --
perltidy is sadly not very flexible).
Some of those changes are, alas, annoyingly intrusive compared to all of
my previous Perl code (which is a chunk of the code in Lintian); for
example, I was convinced to drop the space before the parens on function
calls because it seems to really confuse people coming from just about any
other language except GNU-style C.
I definitely recommend adopting perlcritic and perltidy for this sort of
thing, though, and now use them as part of an automated test suite for my
Perl code.
For a copy of the standard tests that I'm now using, as well as the
perlcriticrc and perltidyrc files (until I can get everything else
updated), clone:
git://git.eyrie.org/devel/rra-c-util.git
and look at tests/data/perl{critic,tidy}rc and the tests in perl/t.
tests/tap/perl/Test/RRA.pm and tests/tap/perl/test/Config.pm may also be
of interest (particularly the former; the latter is used by my tests to
load configuration so that I can reuse the same test scripts across
multiple packages with different requirements).
I'll send the raw Markdown of our new internal style to the Lintian list.
--
Russ Allbery (rra@debian.org) <http://www.eyrie.org/~eagle/>
Reply to: