forked from manicki/psi-toolkit
-
Notifications
You must be signed in to change notification settings - Fork 3
/
CONVENTIONS.txt
46 lines (29 loc) · 1.4 KB
/
CONVENTIONS.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
39
40
41
42
43
44
45
46
General conventions
-------------------
* remove trailing spaces at the end of each line of code (check the
appropriate option in your editor)
* remove trailing lines at the end of the file
* DO NOT USE TAB CHARACTERS, set TAB to 4 spaces in your editor
* do not write lines longer than 100 characters
* use Java-like coding conventions for braces
Naming conventions
------------------
* use FOO_HDR constant at the beginning of header file "foo.hpp"
* use CamelCaseWithFirstLetterUpperCase for class names
* use camelCaseWithFirstLetterLowerCase for methods and local variables
* use camelCaseWithFirstLetterLowerCaseAndTrailingUnderscore_ for
private methods and variables (except for virtual methods, see the
next point)
* virtual methods should not be public - make a non-virtual public method
`foo(..)` in the base class which delegates to virtual private `doFoo(...)`,
`doFoo` should be defined in all the derived classes
* use ALL_UPPER_CASE_LETTERS_AND_UNDERSCORES for constants
Commit messages
---------------
Always write meaningful commit messages. Use English.
For fixes of bugs specified in Redmine use the following convention:
fixes #N (M)
where N is the Redmine bug number, M is the description of the problem
(could be simply the subject of the bug from Redmine). Commits with
such messages will make Redmine close the bug automatically (may take
a couple of minutes, be patient).