Re: PHP-Codesniffer ruleset configuration options
| From: | Greg Sherwood | Date: | Tue, 30 Oct 2012 21:15:20 +0000 |
| Subject: | Re: PHP-Codesniffer ruleset configuration options | ||
| References: | 1 2 3 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-31662@lists.php.net to get a copy of this message | ||
On Wed, Oct 31, 2012 at 12:31 AM, Nicolai Scheer
<nicolai.scheer@gmail.com>wrote:
> Just one little further question:
>
> Why do you use elements rather than XML-Attributes for this?
>
Just to keep everything consistent. For example:
<rule ref="Generic.Commenting.Todo.CommentFound">
<message>Please review this TODO comment: %s</message>
<severity>3</severity>
<type>warning</type>
<properties>
<property name="maxPadding" value="8"/>
<property name="ignoreMultiLine" value="true"/>
<property name="error" value="true"/>
</properties>
</rule>
To me, it doesn't feel consistent to promote the type value to an attribute
when everything else is a sub-tag. Plus, simply removing all the sub-tags
from a rule tag is still valid and just means "include this sniff
unmodified".
Makes sense to me anyway :)
--
Greg Sherwood
Chief of Engineering
gsherwood@squiz.com.au
Squiz Labs Pty. Ltd. Suite 4, 7 Parkes St Parramatta NSW 2150
P +61 2 9045 2800 W www.squizlabs.com