|
|
<table style="border-collapse: collapse; border: none;">
|
|
|
<tr style="border-collapse: collapse; border: none;">
|
|
|
<td style="border-collapse: collapse; border: none;">
|
|
|
<a href="http://www.openairinterface.org/">
|
|
|
<img src="../images/oai_final_logo.png" alt="" border=3 height=50 width=150>
|
|
|
</img>
|
|
|
</a>
|
|
|
</td>
|
|
|
<td style="border-collapse: collapse; border: none; vertical-align: center;">
|
|
|
<b><font size = "5">OAI Software Alliance Branch Policy</font></b>
|
|
|
</td>
|
|
|
</tr>
|
|
|
</table>
|
|
|
|
|
|
Most of the formatting guidelines described in the [indentation page](guidelines/indentation) and [braces-spaces page](guidelines/braces-and-spaces) can be automatically enforced by the use of the `astyle` tool.
|
|
|
|
|
|
At time of writing:
|
|
|
|
|
|
```bash
|
|
|
$ astyle --version
|
|
|
Artistic Style Version 2.05.1
|
|
|
```
|
|
|
|
|
|
Astyle options can be written in a default options file (see astyle -h), an option is to write options in `~/.astylerc` file with the following content:
|
|
|
|
|
|
```bash
|
|
|
# OAI is using a style that is similar to the Google style
|
|
|
--style=google
|
|
|
# long options can be written without the preceding '--'
|
|
|
# Convert tabs to spaces
|
|
|
convert-tabs
|
|
|
# Indentation is 2 spaces
|
|
|
indent=spaces=2
|
|
|
# Indent 'switch' blocks so that the 'case X:' statements are indented in the switch block.
|
|
|
indent-switches
|
|
|
# Indent preprocessor blocks at brace level zero and immediately within a namespace.
|
|
|
indent-preproc-block
|
|
|
# Indent multi-line preprocessor definitions ending with a backslash.
|
|
|
indent-preproc-define
|
|
|
# Indent C++ comments beginning in column one.
|
|
|
indent-col1-comments
|
|
|
break-blocks
|
|
|
delete-empty-lines
|
|
|
align-pointer=name
|
|
|
keep-one-line-blocks
|
|
|
keep-one-line-statements
|
|
|
remove-comment-prefix
|
|
|
# The code line length is 200 characters/columns
|
|
|
max-code-length=200
|
|
|
break-after-logical
|
|
|
```
|
|
|
|