Opened 3 years ago

Last modified 3 years ago

#1487064 new Feature Requests

Coding Standards

Reported by: vminakov Owned by:
Priority: 8 Milestone: later
Component: Core functionality Version: git-master
Severity: normal Keywords:
Cc:

Description

http://trac.roundcube.net/wiki/Dev_Guidelines describes coding standards for roundcube. Those standars are based on PEAR standards with slight modifications. However, I guess there is no obligatory requirement to follow them:

phpcs --standard=PEAR rcmail.php
...
--------------------------------------------------------------------
FOUND 948 ERROR(S) AND 116 WARNING(S) AFFECTING 846 LINE(S)
--------------------------------------------------------------------

Will it make sense, if I write a new coding standard for PHP_CodeSniffer based on PEAR standars? This will make it easier to check the code for coding standards errors before actually commiting it. Anyway, sticking to coding conventions would increase code homogenity, which in turn would result in better maintainability.

Change History (2)

comment:1 Changed 3 years ago by alec

Hard to decide. There's a lot of old code which should be rewritten to match coding standards. All new code should be written according to PEAR CS. Fixing indentation-related errors wouldn't be a big problem, but changeing e.g. class method names will be an issue since we have plugins using it.

comment:2 Changed 3 years ago by vminakov

Well, it shouldn't be a just a single, one-time task, but a continuos long-term refactoring process. Do not introduce new, non-standard compliant code, identify parts that need refactoring and schedule refactoring for future (major) releases - this is how I think, it could be done. Surely, it will break backward-compatibility, but slowly and in a managable way, and not spontaneously. In fact, clear code and propper documentation would result in more contributions and third-party plugins in future.

I could try to identify and classify all coding standards related errors, so that it will build a basis for a further analysis.

Note: See TracTickets for help on using tickets.