Discussion:
[Mason-devel] Need a contractor for HTML::Mason::Critic work
C.J. Adams-Collier
2007-10-13 18:21:46 UTC
Permalink
Hey folks,

I need someone who can help me make HTML::Mason::Critic (ie, Perl::Critic
for Mason components) a reality. Jon and I have mumbled back and forth
about it, but I want to flesh it out. This is a part of a larger project to
build infrastructure around Mason as a "RAD" and "Agile" development system.

As it stands, it is very easy to do it /wrong/ with Mason. There is little
feedback to let new developers know that it is /not/ okay to put logic
inside templates. When compiling, there is no feedback about things like
using $m->print() instead of having the templating system interpolate
variables, etc.

If any of you know someone who would be interested in working on such a
contract that is not on this list, please forward the information. Feel
free to call me on my cell to make recommendations or (oh, please) offer to
help:

+1 206 226 5809

Seattle area is preferred, but we /may/ be able to work something out for
the right remote person.

Cheers,

C.J.
--
moo.
C.J. Adams-Collier
2007-10-13 23:51:20 UTC
Permalink
(cc'ing list, as it is on topic and material to the thread)

only by proxy. look at Perl::Critic. It addresses the issues you've
raised. It is easy to indicate the "policies" applied to a codebase. when
it is appropriate for a component to return() a data structure, disable the
policy which produces the violation message.

Jon and I discussed offline, which is why you have not heard of the project
:)
Post by C.J. Adams-Collier
Hey folks,
I need someone who can help me make HTML::Mason::Critic (ie,
Perl::Critic for Mason components) a reality. Jon and I have mumbled
back and forth about it, but I want to flesh it out. This is a part
of a larger project to build infrastructure around Mason as a "RAD"
and "Agile" development system.
As it stands, it is very easy to do it /wrong/ with Mason. There is
little feedback to let new developers know that it is /not/ okay to
put logic inside templates. When compiling, there is no feedback
about things like using $m->print() instead of having the templating
system interpolate variables, etc.
If any of you know someone who would be interested in working on such
a contract that is not on this list, please forward the information.
Feel free to call me on my cell to make recommendations or (oh,
+1 206 226 5809
Seattle area is preferred, but we /may/ be able to work something out
for the right remote person.
I haven't seen this thread bounced around, but it's quite an interesting
one.
Whilst some of my more successful web applications are pure mason/perl;
our latest generations are all catalyst and mason.
In this context the notion of auto critic would be very useful, even if
just to stop me shouting "This is catalyst" at my staff!
Part of what I see as the problem is the versatility of mason
components.
What is completely wrong in a rendering component might be find in the
right context of a component that's always scomp'd and chooses to return
print $answer;
Do you have much fleshed out in terms of a plan for this?
Regards
--
Gareth Kirwan
Technical Director
Thermeon Europe Ltd,
Tel: +44 (0) 1293 864 303
--
moo.
Dave Rolsky
2007-10-14 04:55:24 UTC
Permalink
Post by C.J. Adams-Collier
I need someone who can help me make HTML::Mason::Critic (ie, Perl::Critic
for Mason components) a reality. Jon and I have mumbled back and forth
about it, but I want to flesh it out. This is a part of a larger project to
build infrastructure around Mason as a "RAD" and "Agile" development system.
Well, I'm not really up to contributing dev time to this ATM, but I have
some ideas about how it could work.

I suspect the best way to implement it would be to start by subclassing
Mason's current ToObject compiler. You can override methods in there to
check for Mason-specific things that might be bad. For example, this would
be a good spot to check for abuse of <%perl> blocks (maybe too long, too
many, any at all, etc).

Then let the superclass do its thing and generate a compiled component,
which is pure Perl. At this point, you can run Perl::Critic against the
compiled code to find other problems, like conditional declarations ("my
$foo if ...").

If you're looking for ideas of Mason-specific policies to implement, I'm
sure I could come up with some.


-dave

/*===================================================
VegGuide.Org www.BookIRead.com
Your guide to all that's veg. My book blog
===================================================*/
C.J. Adams-Collier
2007-10-14 14:51:13 UTC
Permalink
Post by Dave Rolsky
Well, I'm not really up to contributing dev time to this ATM, but I have
some ideas about how it could work.
I suspect the best way to implement it would be to start by subclassing
Mason's current ToObject compiler. You can override methods in there to
check for Mason-specific things that might be bad. For example, this would
be a good spot to check for abuse of <%perl> blocks (maybe too long, too
many, any at all, etc).
Then let the superclass do its thing and generate a compiled component,
which is pure Perl. At this point, you can run Perl::Critic against the
compiled code to find other problems, like conditional declarations ("my
$foo if ...").
If you're looking for ideas of Mason-specific policies to implement, I'm
sure I could come up with some.
-dave
Thanks Dave,

This all sounds great. Any help you can offer would be appreciated. In
particular, Mason-specific policies would be good. I've got some written up
in the wiki at work. I'll check with legal and stuff to see if I can paste
what I've got here. I'll grep through my svn checkout for 'toObject' and
see what I can find out.

Cheers,

C.J.
--
moo.
Dave Rolsky
2007-10-14 15:47:37 UTC
Permalink
Post by C.J. Adams-Collier
This all sounds great. Any help you can offer would be appreciated. In
particular, Mason-specific policies would be good. I've got some written up
in the wiki at work. I'll check with legal and stuff to see if I can paste
what I've got here. I'll grep through my svn checkout for 'toObject' and
see what I can find out.
It's not a method, it's a class, HTML::Mason::Compiler::ToObject. That's
the thing that takes the output of parsing and eventually turns it into
pure Perl code.

If you could start a page for policies on the MasonHQ wiki, that would be
good.


-dave

/*===================================================
VegGuide.Org www.BookIRead.com
Your guide to all that's veg. My book blog
===================================================*/
C.J. Adams-Collier
2007-10-15 01:10:57 UTC
Permalink
Alrighty. I'll touch base with the Perl::Critic list and see if I can get
some pointers from them.

http://www.masonhq.com/?HTML::Mason::Critic
Post by C.J. Adams-Collier
Post by C.J. Adams-Collier
This all sounds great. Any help you can offer would be appreciated. In
particular, Mason-specific policies would be good. I've got some
written up
Post by C.J. Adams-Collier
in the wiki at work. I'll check with legal and stuff to see if I can
paste
Post by C.J. Adams-Collier
what I've got here. I'll grep through my svn checkout for 'toObject'
and
Post by C.J. Adams-Collier
see what I can find out.
It's not a method, it's a class, HTML::Mason::Compiler::ToObject. That's
the thing that takes the output of parsing and eventually turns it into
pure Perl code.
If you could start a page for policies on the MasonHQ wiki, that would be
good.
-dave
/*===================================================
VegGuide.Org www.BookIRead.com
Your guide to all that's veg. My book blog
===================================================*/
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
Mason-devel mailing list
https://lists.sourceforge.net/lists/listinfo/mason-devel
--
moo.
C.J. Adams-Collier
2008-03-07 18:52:40 UTC
Permalink
Since there hasn't been a lot of work here, I'm going to stub out a
module and send it to the CPAN.
Post by C.J. Adams-Collier
Alrighty. I'll touch base with the Perl::Critic list and see if I can get
some pointers from them.
http://www.masonhq.com/?HTML::Mason::Critic
Post by Dave Rolsky
Post by C.J. Adams-Collier
This all sounds great. Any help you can offer would be appreciated. In
particular, Mason-specific policies would be good. I've got some
written up
Post by Dave Rolsky
Post by C.J. Adams-Collier
in the wiki at work. I'll check with legal and stuff to see if I can
paste
Post by Dave Rolsky
Post by C.J. Adams-Collier
what I've got here. I'll grep through my svn checkout for 'toObject'
and
Post by Dave Rolsky
Post by C.J. Adams-Collier
see what I can find out.
It's not a method, it's a class, HTML::Mason::Compiler::ToObject. That's
the thing that takes the output of parsing and eventually turns it into
pure Perl code.
If you could start a page for policies on the MasonHQ wiki, that would be
good.
-dave
/*===================================================
VegGuide.Org www.BookIRead.com
Your guide to all that's veg. My book blog
===================================================*/
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
Mason-devel mailing list
https://lists.sourceforge.net/lists/listinfo/mason-devel
--
moo.
--
moo.
Loading...