[Owncloud] Coding guidelines for codesniffer and CI

Thomas Müller thomas.mueller at tmit.eu
Mon Jul 30 15:01:00 UTC 2012


Hi,

I'd like to point you to a new page on the ownCloud dev center:
http://owncloud.org/coding-style-guide/

Based on the discussions on IRC and the fine tuning of PHP Code Sniffer I 
quickly wrote that page as a starting point to specify the ownCloud coding style guide.

This just a starting point and some topics have not been discussed yet.

Your feedback is more than welcome!

Thanks a lot,

Tom


Am Donnerstag, dem 19.07.2012 um 2:26 schrieb Jörn Friedrich Dreyer:
> Tom aka DeepDiver has already done amazing QA work with setting up a 
> jenkins server for continuous integration. Now we need to decide on a 
> code style that we can teach PHP CodeSniffer. But why use a common code 
> style at all, when every one of us is already familiar with his best 
> practice? Code is read more often than it is written. And reading is a 
> lot easier when I am already familiar with the formatting. Especially, 
> when hunting bugs in other peoples code.
> 
> Instead of raising another coding guidelines discussion I would like 
> each one of you to choose from the two general approaches we have:
> 
> [extend] We extend the guidelines on http://owncloud.org/dev/contribute/ 
> to create the level of detail needed for PHP CodeSniffer and gradually 
> increase the number of checks over time
> 
> [adopt] We adopt a standard code style like PEAR [1] or Squiz and go 
> from 
> there<http://www.squizlabs.com/php-codesniffer/how-much-does-your-standard-check>. 
> PEAR was meant to increase readability and Squiz is very strict [2]. 
> PEAR for example reqires a space between control structures and 
> brackets: "} else {" instead of "}else{".
> 
> Personally, I vote for the adoption of a mix of PEAR and Squiz as a 
> solid base where we add our current guidelines, eg: use tabs to indent 
> and placement of brackets.
> 
> What is your opinion?
> 
> [1] http://pear.php.net/manual/standards.php
> [2] 
> http://www.squizlabs.com/php-codesniffer/how-much-does-your-standard-check
> 
> -- 
> Jörn Friedrich Dreyer (jfd at owncloud.com)
> Software Developer
> ownCloud GmbH
> 
> Your Data, Your Cloud, Your Way!
> 
> ownCloud GmbH, GF: Markus Rex, Holger Dyroff
> Schloßäckerstrasse 26a, 90443 Nürnberg, HRB 28050 (AG Nürnberg)



More information about the Owncloud mailing list