@mattab opened this Issue on March 20th 2009 Member

Currently Piwik Coding Standard are documented here: Piwik Coding Standard.

But they have a number of slight differences with the Zend Framework Coding Standards, that are not justified. It would be ideal if Piwik used the same (very standard and widely used) Zend Framework Coding Standard.

Main differences:

  • if else bracket indentation. The one used in Piwik makes the code a bit harder to read as it takes more lines.
  • using four spaces for for indentation rather than tabs

Is there a script (or eclipse plugin for example) we can use to run all Piwik .php against, to automatically modify all files against this standard?

After quick research there seem to be some solution

Note that we're not looking into adding a post commit hook to enforce that the guide is respected, it's more about fixing the existing code in an automated manner in a "one shot" run of some script.

If anybody wants to tackle this, please comment! thanks.

@anonymous-piwik-user commented on May 17th 2009

keep tabs please. not everybody prefers an indentation of 4 spaces

@mattab commented on March 29th 2010 Member

The Zend coding standards state 4 spaces, so if we follow them directly (which is what the idea is for now), it would be 4 spaces.

The next step is to find an automated solution to convert all existing code to new standards.

@robocoder commented on March 29th 2010 Contributor

vote wontfix. Inflating the files to conform to a whitespace "standard is silly.

We also deviate from ZF's class naming standards, i.e.,

  • 'core/' & 'plugins/' instead of 'Piwik/'
  • one class per file
@mattab commented on March 29th 2010 Member

My main motivation was the change in curly brackets, put at the end of the line rather that on its own line. I came to like this presentation more after programming in Java.. now it might not be a good enough reason ;)

@mattab commented on March 31st 2010 Member

OK I think This is not as important as other things. If someone finds an automated way of converting the existing source code to ZF standards (we can keep our indentation = tab preference), please write a comment

@mattab commented on July 29th 2010 Member

works as it is for now!

This Issue was closed on July 29th 2010
Powered by GitHub Issue Mirror