PHP-Codesniffer ruleset configuration options
| From: | Nicolai Scheer | Date: | Mon, 29 Oct 2012 13:31:10 +0000 |
| Subject: | PHP-Codesniffer ruleset configuration options | ||
| Groups: | php.pear.general | ||
| Request: | Send a blank email to pear-general+get-31657@lists.php.net to get a copy of this message | ||
Hi!
We are currently using PHP-Codesniffer very successfully... There's
only one single "issue" that bothers me right now.
I built my own ruleset.xml referencing various sniffs from other
shipped standards, e.g.:
<rule ref="Generic.Formatting.NoSpaceAfterCast"/>
From reading the docs I can conclude that it is possible to adjust (or
override) the default severity for this sniff.
Is it possible to override the warning/error behaviour of a sniff?
I.e. specify which referenced sniff should produce a warning or an
error?
We check coding styles during a subversion pre-commit hook. There are
some referenced sniffs that I'd like to emit a warning rather than an
error. Of course I could just copy the sniff's code into my own
standard and adjust it, but I'd rather not duplicate code that way
(mainly to benefit from updates without manually interfering all the
time).
Any suggestions?
Thanks and greetings
Nico