Documentation

HowToContribute

If you are reading this page, you are interested to contribute for the CodingTeam project. You should follow theses steps:

  1. Start by contact us. We could speak about what is really needed and what you want to do. So, you can go on the codingteam-dev@ XMPP room.
  2. After, you can take a look of planned work on the CodingTeam roadmap.
  3. Start working!

 

Documentation formatting convention

We are currently working on the code documentation of CodingTeam. So, every new work should be documented.

A comment describing what a file does at the start of it.

0 1 2 3 4 5 6
  /**
   * @file
   * Crazy things
   *
   * This file is doing crazy things as I said
   * before.
   */

Functions that may be called elsewhere should be documented.

0 1 2 3 4 5 6 7 8 9 10 11 12 13
/**
 * Translate a string and add arguments
 *
 * Gets the translated string from gettext and add arguments in it with
 * the Python way instead of the *ugly* PHP way (sprintf).
 *
 * @param $str
 *   The string to be translated.
 * @param $args
 *   All arguments to be added.
 * @return
 *   The translated and formatted string.
 */
function i18n($str, $args=array())

Last but not least, all comments must be wrote in english.

 

Code writting convention

  • A curly brackets takes one line.
    • Good
      0 1
      if ($condition)
      {
      
      0 1
      echo 'Hello World';
      }
      
    • Bad
      0
      if ($condition) {
      
      0
      echo 'Hello World'; }
      
  • Indentation with 4 spaces.
    0 1 2
    {
        echo 'ok';
    }
    
  • Think i18n.
    • Good
      0
      echo i18n('Hello, %(nick)s.', array('nick' => $nickname));
      
    • Bad
      0
      echo i18n('Hello').','.$nickname.'.';
      

 

Remarks

  • Use mbstring to handle strings.
  • Maximum line length is 79 characters.

Perhaps our code doesn't follow completely that. It's a problem. :(

 
This page feed: RSS or Atom.
Global feed: RSS or Atom.