<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Milton Soares Filho &#187; shell script</title>
	<atom:link href="http://blog.msoares.pro.br/tags/shell-script/feed" rel="self" type="application/rss+xml" />
	<link>http://blog.msoares.pro.br</link>
	<description>Random rants and SW developers' stuff</description>
	<lastBuildDate>Mon, 08 Aug 2011 16:02:28 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Qt Codestyle Automatic Check</title>
		<link>http://blog.msoares.pro.br/archives/qt-codestyle-automatic-check</link>
		<comments>http://blog.msoares.pro.br/archives/qt-codestyle-automatic-check#comments</comments>
		<pubDate>Sun, 14 Jun 2009 05:38:45 +0000</pubDate>
		<dc:creator>milton</dc:creator>
				<category><![CDATA[Planet INdT]]></category>
		<category><![CDATA[astyle]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[code style]]></category>
		<category><![CDATA[coding]]></category>
		<category><![CDATA[devel]]></category>
		<category><![CDATA[qt]]></category>
		<category><![CDATA[shell script]]></category>
		<category><![CDATA[testcase]]></category>

		<guid isPermaLink="false">http://blog.msoares.pro.br/?p=133</guid>
		<description><![CDATA[Code style carries many benefits, such as improved maintainability and support for a rich Coding Standard. However it&#8217;s not safe to rely on developers to always comply to style rules along the source code, that&#8217;s why automatic code style verification should be an initial concern for professional-level works. For the sake of coding-style-importance-aware people, there [...]]]></description>
			<content:encoded><![CDATA[<p>Code style carries many <a href="http://www.articlesbase.com/programming-articles/10-benefits-of-using-coding-standards-to-software-development-team-312610.html">benefits</a>, such as improved maintainability and support for a rich <a href="http://www.ademar.org/texts/coding.html">Coding Standard</a>. However it&#8217;s not safe to rely on developers to always comply to style rules along the source code, that&#8217;s why automatic code style verification should be an initial concern for professional-level works.</p>

<p>For the sake of <em>coding-style-importance-aware people</em>, there are many great projects such as <a href="http://www.gnu.org/software/indent"><span class="caps">GNU </span>indent</a>, <a href="http://svn.browsershots.org/trunk/devtools/pep8/pep8.py">pep8</a> and <a href="http://astyle.sourceforge.net">astyle</a> that perform all the work for you, whose only need the appropriate setup <a href="http://techbase.kde.org/Policies/Kdelibs_Coding_Style">flags</a>.</p>

<p>For Qt projects, astyle is the recommended tool. But there are a few drawbacks on using it.</p>

<ul>
<li>it&#8217;s too intrusive. astyle performs code modification in-line, disturbing the repository sources instead of serving as a verification tool only</li>
<li>weak didactic factor. Unlike pep8 script, which tells the developer exactly what the problem is and contributes to avoid it at the future (as a <em>lesson learned</em> effect)</li>
<li>it&#8217;s output can not be <strong>easily</strong> integrated with another tools</li>
</ul>

<p>I&#8217;ve created a shell script in order to overcome some of the previous issues. It&#8217;s available <a href="http://gitorious.org/qt-codecheck">here</a>. Some relevant features.</p>

<ul>
<li><a href="http://www.vim.org/htmldoc/quickfix.html">quickfix</a>-style list output
</li>
<li><a href="http://doc.qtsoftware.com/4.5/qtestlib-manual.html">QTest</a> style output at the end
</li>
<li>Ignore moc created files</li>
<li>All suggested modifications can be applied as one patch, directly available to the user</li>
<li>Can be run inside a testsuite (make test) or as a standalone program
</li>
</ul>

<p><span class="caps">TODO</span></p>

<ul>
<li>try to <a href="http://astyle.sourceforge.net/develop">extend</a> astyle classes</li>
<li>allow alternative code styles</li>
<li>better source selection schema (integrated with qmake, maybe?)</li>
<li>fix-up improper indentation on some important macros (foreach, .e.g.)</li>
<li>test and make it work on MacOS</li>
</ul>]]></content:encoded>
			<wfw:commentRss>http://blog.msoares.pro.br/archives/qt-codestyle-automatic-check/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

