[TYPO3-dev] SVN pre-commit hooks to avoid commiting php files with syntax errors

Fabrizio Branca news at _REMOVETHIS_fabrizio-branca.de
Mon Sep 21 18:44:42 CEST 2009


Having this as an option would surely be the best solution. But as it 
seems to be a bigger task to have this enabled on a per-project-basis 
does that mean we should not try this at all?

I don't see the problems you see:

1) The only errors that are detected are syntax errors. Of course that 
does not include checking if interfaces are implemented correctly and 
many other things! But better checking some things, than checking 
nothing! (You won't never be able to check _everything_ automatically. 
Even using Unit-Tests you won't be able to do that)

2) I think we can rely on the check because it is php itself to check 
the syntax. We'll propably need a current version of PHP installed on 
that so, because Namespaces will lead to syntax errors while checking 
using a php binary < 5.3.

3) If developers want to store some pseudo code into svn (if this is the 
way the work) they should clearly separate them from the effective php 
code. This can be easily done by choosing another file extension as only 
*.php will be parsed. Even without such a hook I would avoid committing 
pseudo code into php files.

Bye,

Fabrizio




More information about the TYPO3-dev mailing list