[DDC-585] Create a coding standards document Created: 13/May/10  Updated: 20/Jul/15

Status: Open
Project: Doctrine 2 - ORM
Component/s: None
Affects Version/s: None
Fix Version/s: 2.x
Security Level: All

Type: Documentation Priority: Major
Reporter: Roman S. Borschel Assignee: Jonathan H. Wage
Resolution: Unresolved Votes: 1
Labels: CS

Issue Links:
is referenced by DDC-3841 [GH-1470] [CI] Added dev requirement ... Open
is referenced by DDC-2408 [GH-649] Update coding standards Resolved


We need a new coding standards document for Doctrine 2.

Comment by Benjamin Morel [ 29/Jan/13 ]

Has there been any work on a coding standards document yet?
I'm currently working on fixing documentation on this project, and it might be a good time to define a standard.
I've started compiling a few recommendations based on various feedbacks I've got in my pull requests, and I can post them here.
Please let me know if there have been previous attempts so far!

Comment by Marco Pivetta [ 29/Jan/13 ]

Benjamin Morel Guilherme Blanco may have a CS ruleset, but it's not ready yet. Perfect timing btw, we really need to automate this to avoid having all these useless CS fix comments in pull requests

Comment by Benjamin Morel [ 29/Jan/13 ]

Ok, I'll post my document here once ready, and Guilherme Blanco will be able to compare it with his ruleset!

Comment by Benjamin Morel [ 30/Jan/13 ]

Here is a first draft: https://gist.github.com/4676670

Please comment!

Comment by Benjamin Morel [ 11/Feb/13 ]

Guilherme Blanco, if you don't have time to compare your ruleset with my draft, maybe you could publish your current ruleset so that others can have a look?

Comment by Benjamin Morel [ 02/Aug/13 ]

Any update guys? I'm willing to spend some time on this work, but if no one answers, we won't be going forward

Comment by Marco Pivetta [ 02/Aug/13 ]

Benjamin Morel I think a pull request against the doctrine website (https://github.com/doctrine/doctrine-website-sphinx) would be fine...

Comment by Steve Müller [ 17/Apr/14 ]

This should go into https://github.com/doctrine/coding-standard repo (long term).

Comment by Phansys [ 14/Jul/15 ]

Could we define PSR-2 as base?

Comment by Marco Pivetta [ 15/Jul/15 ]

Please just refer to https://github.com/doctrine/coding-standard, which is already PSR-2 based (with variations and more strictness)

Comment by Phansys [ 15/Jul/15 ]

@ocramius, Is there a rule for spaces arround `!` operator? https://github.com/doctrine/doctrine2/pull/1133#discussion_r17459791

Comment by Phansys [ 15/Jul/15 ]

I just found another set of rules inside https://github.com/doctrine/doctrine2/blob/14ff7f50cfea67d8a4dca37b8ca364d2a83b9864/CONTRIBUTING.md#coding-standard. Which is the current valid standard?

Comment by Marco Pivetta [ 15/Jul/15 ]

Phansys yes, that's doctrine specific (spaces around {{ ! }} )

Comment by Phansys [ 15/Jul/15 ]

Perfect! https://github.com/FriendsOfPHP/PHP-CS-Fixer/pull/1303
What about the disambiguation between the CS? https://github.com/doctrine/coding-standard/tree/master/Docs#doctrine-coding-standard vs https://github.com/doctrine/doctrine2/blob/14ff7f50cfea67d8a4dca37b8ca364d2a83b9864/CONTRIBUTING.md#coding-standard

Generated at Thu Oct 08 19:37:34 EDT 2015 using JIRA 6.4.10#64025-sha1:5b8b74079161cd76a20ab66dda52747ee6701bd6.