Re: Correcting plugin syntax errors

2008-08-02 Thread Steve Kemp
Well thanks for the big thread, and useful comments. I took the conclusion that the syntax testing, in isolation, was generally viewed to be a bad idea and that it might actually make more sense to *remove* any occurances of "use ..constants" from existing plugins, so we could test elsewher

Re: Correcting plugin syntax errors

2008-07-30 Thread Jose Luis Martinez
Matt Sergeant escribió: On Tue, 29 Jul 2008, Jose Luis Martinez wrote: BTW: any comment on how to elaborate a testing framework. Comments from the QP-gurus would be helpful. For some in house code here that's similar to Qpsmtpd we basically have a data driven test system. You specify in a co

Re: Correcting plugin syntax errors

2008-07-29 Thread Matt Sergeant
On Tue, 29 Jul 2008, Jose Luis Martinez wrote: BTW: any comment on how to elaborate a testing framework. Comments from the QP-gurus would be helpful. For some in house code here that's similar to Qpsmtpd we basically have a data driven test system. You specify in a config file what plugins to

Re: Correcting plugin syntax errors

2008-07-29 Thread Peter J. Holzer
On 2008-07-28 22:54:20 -0700, Robert Spier wrote: > Matt Sergeant wrote: > > On Mon, 28 Jul 2008 20:47:39 -0400, Brian Szymanski wrote: > > > Then let's make that diff instead - remove all the "use > > > Qpsmtpd::Constants" in plugins, and add your test harness? > > > > I agree. Make your tester r

Re: Correcting plugin syntax errors

2008-07-29 Thread Jose Luis Martinez
Matt Sergeant escribió: On Mon, 28 Jul 2008 20:47:39 -0400, Brian Szymanski wrote: Then let's make that diff instead - remove all the "use Qpsmtpd::Constants" in plugins, and add your test harness? I agree. Make your tester run the same code in Qpsmtpd.pm (or is it now in Plugin.pm, I don't r

Re: Correcting plugin syntax errors

2008-07-29 Thread Ask Bjørn Hansen
The inspiration for the "file based plugins" were Apache::Registry in mod_perl -- hide as much of the nitty gritty as possible and allow the user to just write the code that actually does stuff for them. On that track then I think it's reasonable to add whatever boiler plate code is need

Re: Correcting plugin syntax errors

2008-07-28 Thread Brian Szymanski
Robert Spier wrote: >> I may have an extreme view on this, but... Systems that re-use the same >> module in lots of other different modules tend to annoy me, because the >> author hasn't thought out what needs to be imported when - instead >> they've just fired a shotgun blast of use statements aro

Re: Correcting plugin syntax errors

2008-07-28 Thread Robert Spier
> I may have an extreme view on this, but... Systems that re-use the same > module in lots of other different modules tend to annoy me, because the > author hasn't thought out what needs to be imported when - instead > they've just fired a shotgun blast of use statements around until things > stopp

Re: Correcting plugin syntax errors

2008-07-28 Thread Brian Szymanski
Robert Spier wrote: > Matt Sergeant wrote: > >> On Mon, 28 Jul 2008 20:47:39 -0400, Brian Szymanski wrote: >> >>> Then let's make that diff instead - remove all the "use >>> Qpsmtpd::Constants" in plugins, and add your test harness? >>> >> I agree. Make your tester run the same code

Re: Correcting plugin syntax errors

2008-07-28 Thread Robert Spier
Matt Sergeant wrote: > > On Mon, 28 Jul 2008 20:47:39 -0400, Brian Szymanski wrote: > > Then let's make that diff instead - remove all the "use > > Qpsmtpd::Constants" in plugins, and add your test harness? > > I agree. Make your tester run the same code in Qpsmtpd.pm (or is it now > in Plugin

Re: Correcting plugin syntax errors

2008-07-28 Thread Matt Sergeant
On Mon, 28 Jul 2008 20:47:39 -0400, Brian Szymanski wrote: > Then let's make that diff instead - remove all the "use > Qpsmtpd::Constants" in plugins, and add your test harness? I agree. Make your tester run the same code in Qpsmtpd.pm (or is it now in Plugin.pm, I don't recall) that compiles the

Re: Correcting plugin syntax errors

2008-07-28 Thread Brian Szymanski
Steve Kemp wrote: > On Mon Jul 28, 2008 at 17:24:59 -0400, Brian Szymanski wrote: > > >> What real errors would your diffs catch? The one case you showed >> involved a false positive. >> > > With the assumption that you run "make test" prior to commiting > then it would catch a genuine s

Re: Correcting plugin syntax errors

2008-07-28 Thread Steve Kemp
On Mon Jul 28, 2008 at 17:24:59 -0400, Brian Szymanski wrote: > What real errors would your diffs catch? The one case you showed > involved a false positive. With the assumption that you run "make test" prior to commiting then it would catch a genuine syntax error. Such as the following whic

Re: Correcting plugin syntax errors

2008-07-28 Thread Brian Szymanski
Steve Kemp wrote: > On Mon Jul 28, 2008 at 16:44:08 -0400, John Peacock wrote: > > >> The plugins were not originally intended to be complete Perl scripts but >> rather are stubs which are loaded by Qpsmptd::Plugins (which includes >> Qpsmtpd::Constants already). It doesn't actually hurt to

Re: Correcting plugin syntax errors

2008-07-28 Thread Steve Kemp
On Mon Jul 28, 2008 at 16:44:08 -0400, John Peacock wrote: > The plugins were not originally intended to be complete Perl scripts but > rather are stubs which are loaded by Qpsmptd::Plugins (which includes > Qpsmtpd::Constants already). It doesn't actually hurt to apply the > patch, but it

Re: Correcting plugin syntax errors

2008-07-28 Thread John Peacock
Steve Kemp wrote: There are several of the plugins contained are in the repository which fail to pass a basic perl syntax check, for example: The plugins were not originally intended to be complete Perl scripts but rather are stubs which are loaded by Qpsmptd::Plugins (which includes Qpsmt