[Owncloud] Coding guidelines for codesniffer and CI
Arthur Schiwon
blizzz at owncloud.com
Mon Jul 23 10:47:56 UTC 2012
On 07/19/2012 02:26 AM, Jörn Friedrich Dreyer wrote:
> 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.
I'm fine with PEAR and our specifics on top (e.g. the famous curly
brackets on the same line and tabs instead of spaces).
Cheers
Arthur
>
> 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
>
>
>
> _______________________________________________
> Owncloud mailing list
> Owncloud at kde.org
> https://mail.kde.org/mailman/listinfo/owncloud
>
More information about the Owncloud
mailing list