/
code_style.txt
38 lines (27 loc) · 1.43 KB
/
code_style.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
Code style
==========
.. sidebar:: Configure Visual Studio
Open *Tools / Text Editor / All languages / Tabs*
and configure as follows:
* Indenting - smart,
* Tab size - 2,
* Indent size - 2,
* Select "insert spaces".
We also suggest to configure Visual Studio to
`show space and tab crlf characters <http://stackoverflow.com/questions/4065815/how-to-turn-off-showing-whitespace-characters-in-visual-studio-ide>`_
(shortcut: Ctrl+R, Ctrl+W),
and `enable vertical line at 120 characters <http://stackoverflow.com/questions/9894397/100-characters-line-marker-in-visual-studio>`_.
In the code we follow
`google code style <http://google-styleguide.googlecode.com/svn/trunk/cppguide.xml>`_
with the following changes:
* Exceptions are allowed
* Indentation must be 2 spaces. Tabs are not allowed.
* No lines should exceed 120 characters.
All .h and .cpp files under ``$(BIGARTM_ROOT)/src/artm/`` must be verified for code style with
`cpplint.py <https://raw.githubusercontent.com/google/styleguide/gh-pages/cpplint/cpplint.py>`_ script.
Files, generated by protobuf compiler, are the only exceptions from this rule.
To run the script you need some version of Python installed on your machine.
Then execute the script like this:
``python cpplint.py --linelength=120 <filename>``
On Windows you may run this master-script to check all required files:
``$(BIGARTM_ROOT/utils/cpplint_all.bat``.