Difference between revisions of "Coding Rules"

From ArmadeusWiki
Jump to: navigation, search
m (C files)
Line 2: Line 2:
  
 
==C files==
 
==C files==
* Both userspace or driver code shall use the Linux kernel "coding style". Details are given here: ''buildroot/output/build/linux-x.x/Documentation/CodingStyle''
+
* Both user space or driver code shall use the Linux kernel "coding style". Details are given here: ''buildroot/output/build/linux-x.x/Documentation/CodingStyle''
 
* If not sure, one can use the following script to automagically indent its source files: ''buildroot/output/build/linux-x.x/scripts/Lindent''
 
* If not sure, one can use the following script to automagically indent its source files: ''buildroot/output/build/linux-x.x/scripts/Lindent''
  

Revision as of 23:00, 14 October 2012

This page defines the Coding Rules that apply to all the source code of the Armadeus Project BSP.

C files

  • Both user space or driver code shall use the Linux kernel "coding style". Details are given here: buildroot/output/build/linux-x.x/Documentation/CodingStyle
  • If not sure, one can use the following script to automagically indent its source files: buildroot/output/build/linux-x.x/scripts/Lindent

C++ files

  • 2 possibilities:
    • either comply with the "C files" Conding Rules listed just above or,
    • follow the Qt Coding Style.

Python files

  • No rules defined yet.

Makefiles

  • Makefiles syntax is already rigid enough to limit coder excentricity :-)
  • However: constants should be in Uppercase.

Bash scripts

  • Indentation: 1 Tabulation,
  • Do not use more than 132 columns,
  • Constants in Uppercase.

Licences

  • Armadeus Project only accept sources that comply with the major Licenses available in the Free Software community: GPL, GPLv2, LGPL or BSD.