[TYPO3-core] CGL proposal: Include PSR-1 Side Effects-Rule

Andy Grunwald [wmdb] andreas.grunwald at wmdb.de
Mon Oct 22 15:14:36 CEST 2012


Am 21.10.2012 12:14, schrieb Jigal van Hemert:
>
> The magic word here is "SHOULD". I'm pretty sure a code sniffer cannot
> judge whether "there may exist valid reasons in particular circumstances
> to ignore" (quote from RFC 2119) the rule.
> The result is that a code sniffer cannot enforce such a rule.
>

Hey Jigal,

yes of course. You are right.
Every rule we define in CodeSniffer is only a hint to the developer that 
there might be something wrong / not correct as the cgl said.
In some cases it might be useful to ignore this rule.
This tool is only a static analysis. This tool is "dumb" like every 
computer and can`t replace a human with deep knowledge about the problem 
itselfs.
For this we got some files / cases excluded in our standard.
If we find such a exception, we will exclude it :)

At the word should:
Of course there is a big difference between MUST and SHOULD.
SHOULD can be a best practice recommendation.
For this two words there are two cases of errors:

* MUST => Error
* SHOULD => Warning

The sniff (computed rule to check this recommendation) will raise (in 
case of detection) only a warning. Not an error.
This is the technical representation of the word "SHOULD".

This discussion is about the main thing:
Do you think this rule seems useful in case of reusable code?
Or do you say this rule is not needed here?
+1 / 0  or -1? :)

If you got further questions, i`m waiting for it!
Thanks for your opinion anyway!

Andy


More information about the TYPO3-team-core mailing list