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

Re: Tests to assure debug remnants are not in our sources?

On Mon, Sep 14, 2015 at 2:49 PM, R. Ransbottom <..hidden..> wrote:
On Fri, Sep 11, 2015 at 11:05:48PM +0200, Erik Huelsmann wrote:

> Every once in a while, some debug code ends up in a release.

> "use Carp::Always"
> "use Data::Dumper"
> "print STDERR"

> not to appear in any files in LedgerSMB/, bin/ and LedgerSMB.pm

> Any objections?

Use perlcritic.

Hi Rob,

Thanks for the pointer! I've implemented a few initial tests using Perl::Critic in our standard test suite now:

1. No hard tabs
2. No trailing whitespace
3. No "evil" modules (Data::Dumper, Carp::Always)
4. Require 'use strict' and 'use warnings'

Unfortunately, I haven't found a policy which checks for 'print STDERR'...

I always feel ambivalent as I remove debug code.  "The code must not
be that readable" versus "this verification is so unnecessary it is

Yea. In general, it's simply better to have official tests in t/ for the type of test code we're addressing here. 

This is what we have now: https://raw.githubusercontent.com/ledgersmb/LedgerSMB/master/t/01.1-critic.t

Do you have anything to suggest we should add?




http://efficito.com -- Hosted accounting and ERP.
Robust and Flexible. No vendor lock-in.
Ledger-smb-devel mailing list