<?xml version="1.0" encoding="UTF-8"?>

<rss version="2.0" xmlns:blogChannel="http://backend.userland.com/blogChannelModule">

<channel>
<title><![CDATA[Hackathon Chicago, Nov 10-12, 2006: Perl::Critic]]></title>
<link>http://www.perlfoundation.org/hackathon-chicago/index.cgi?perl_critic</link>
<description></description>
<pubDate>Thu, 23 Aug 2007 18:27:13 -0000</pubDate>
<webMaster>synedra@gmail.com</webMaster>
<generator>Socialtext Workspace v2.14.7.2</generator>

<item>
<title><![CDATA[Perl::Critic]]></title>
<link>http://www.perlfoundation.org/hackathon-chicago/index.cgi?perl_critic</link>
<description><![CDATA[<div class="wiki">
<p>
Leader: <a href="http://www.perlfoundation.org/hackathon-chicago/index.cgi?chris_dolan" title="(70 months) Worked on Perl Critic at the hackathon. Developer at Clotho Advanced Media and MediaLandscape Softwa...">Chris Dolan</a> (Attending Saturday only)<br />
Interested: <a href="http://www.perlfoundation.org/hackathon-chicago/index.cgi?andy_lester" title="(70 months)  image andy-moose.jpg One of the two organizers of this little shindig, and proud member of Chicago ...">Andy Lester</a><br />
Interested: <a href="http://www.perlfoundation.org/hackathon-chicago/index.cgi?elliot_shank" title="(70 months) http galumph.com images Gargoyle-150x150.jpg When was the last time that YOU galumphed http galumph....">Elliot Shank</a><br />
Interested: <a href="http://www.perlfoundation.org/hackathon-chicago/index.cgi?michael_r_wolf" title="(70 months) I learned Perl in a day, solved a problem the following day, and have been using and mastering it ev...">Michael R. Wolf</a></p>
<p>
Perl::Critic is an extensible framework for creating and applying coding standards to Perl source code. Essentially, it is a static source code analysis engine, like lint for C. New policies are getting added to Perl::Critic all the time, and you can help your fellow Perl programmers write cleaner, safer code.</p>
<p>
<a target="_blank" title="(external link)" href="http://perlcritic.tigris.org/">http://perlcritic.tigris.org/</a></p>
<h1 id="getting_started">Getting Started</h1>
<p>
Before the hackathon, you should download the latest Perl::Critic from our SVN repository, and install all of its prerequisites:</p>
<blockquote>
<tt>% cpan install Perl::Critic</tt><br />
<tt>% svn checkout http://perlcritic.tigris.org/svn/perlcritic/trunk perlcritic</tt></blockquote>
<br /><p>
Username: &quot;guest&quot;<br />
Password: &quot;&quot; (blank)</p>
<h1 id="how_to_help">How to help</h1>
<p>
You don't have to actually know Perl::Critic or PPI's internals to help out. Most of the work is writing test cases and thinking through the logic of matching Perl code.</p>
<p>
You can (in order from easiest to hardest):</p>
<ul>
<li>Choose good policies to implement</li>
<li>Write some positive and negative tests</li>
<li>Come up the corner cases.</li>
<li>Write pseudo-code and docs</li>
<li>Write the PPI implementation of pseudo-code</li>
<li>Hack PPI</li>
</ul>
<h2 id="items_to_do">Items to-do</h2>
<p>
Here are a few Policy ideas from our TODO list that would greatly benefit the project. Policies typically live in the Perl::Critic::Policy:: namespace.</p>
<p>
<strong>InputOutput::ProhibitJoinedReadline</strong> - recommend &quot;local $/ = undef&quot; instead</p>
<p>
<strong>RegularExpressions::ProhibitComplexRegexps</strong> - If regexp is longer than N characters/lines, recommend it be split into &quot;qr//&quot; pieces</p>
<p>
<strong>TestingAndDebugging::ProhibitProlongedStrictureOverride</strong> - Make sure that the lexical scope of a &quot;no strict&quot; is less than N lines</p>
<ul>
<li>Done!</li>
</ul>
<p>
<strong>Variables::ProhibitTopicChangeInListFunction</strong> - avoid things like &quot;map {s/ /+/g} @urls&quot;. Recommend for loops instead. Oh, and try to think up a better name.</p>
<ul>
<li>How about ProhibitVoidMap</li>

<ul>
<li>That's not the same, and it's already implemented!</li>
</ul></ul>
<p>
<strong>ValuesAndExpressions::ProhibitComplexVersion</strong> - <a target="_blank" title="(external link)" href="http://rt.cpan.org/Ticket/Display.html?id=20439">http://rt.cpan.org/Ticket/Display.html?id=20439</a></p>
<h2 id="profiling">Profiling</h2>
<p>
Perl::Critic can be a resource pig. Profile it and help find the hot spots.</p>
<blockquote>
<tt>% perl Build.PL</tt><br />
<tt>% ./Build</tt><br />
<tt>% perl -Mbib -d:DProf t/40_criticize.t</tt><br />
<tt>% dprofpp</tt></blockquote>
<br /><h2 id="incorporate_perl_critic_rules_into_your_projects">Incorporate Perl::Critic rules into your projects</h2>
<p>
This is a great way to get your feet wet and understand the power, and limitations, of Perl::Critic.</p>
<p>
You can:</p>
<ul>
<li>Install Perl::Critic</li>
<li>Run &quot;perlcritic -top MyModule.pm&quot;</li>
<li>Create a custom config file</li>
<li>Install Test::Perl::Critic</li>
<li>Add a t/perlcritic.t to your dist</li>
</ul>
<h2 id="perl_critic_bangs">Perl::Critic::Bangs</h2>
<p>
<a href="http://www.perlfoundation.org/hackathon-chicago/index.cgi?andy_lester" title="(70 months)  image andy-moose.jpg One of the two organizers of this little shindig, and proud member of Chicago ...">Andy Lester</a>'s set of extensions. One of them checks for variable names ending with digits, but $md5 should be OK.</p>
<h2 id="random">Random</h2>
<p>
<a href="http://www.perlfoundation.org/hackathon-chicago/index.cgi?andy_lester" title="(70 months)  image andy-moose.jpg One of the two organizers of this little shindig, and proud member of Chicago ...">Andy Lester</a> is having a problem where he runs P::C against <a href="http://www.perlfoundation.org/hackathon-chicago/index.cgi?socialtext_open" title="(70 months) Leader [Andy Lester] Socialtext Open is the software on which this wiki runs. A list of tasks is ava...">Socialtext Open</a> and it complains about &quot;Capture variable used outside conditional&quot;, but that's apparently not true.</p>
</div>
]]></description>
<author>hackathon@chrisdolan.net</author>
<guid isPermaLink="true">http://www.perlfoundation.org/hackathon-chicago/index.cgi?perl_critic</guid>
<pubDate>Thu, 23 Aug 2007 18:27:13 -0000</pubDate>
</item>

</channel>
</rss>