-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathHACKING
90 lines (59 loc) · 3.7 KB
/
HACKING
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
Contributing to this project
============================
This file describes some development practices and coding standards for this project. Its syntax follows the rst format.
This file is in the public domain.
Coding style
------------
Let's now describe a bit the C++ coding style in this project.
(this is just a proposal for now, please modify.)
* variables should camelcase. Like "eggSpam".
* Class attributes should be camelcase, with a trailing underscore. Like "eggSpam_".
* Class/type names should be camel case with the first letter capital. Like "EggSpam".
* File names should be lowercase, and the words should be spearated by underscores. Like "egg_spam.cpp" and "egg_spam.h".
* The file name should be named after the single class it contents, if possible.
* Avoid global functions, they should be enclosed in a namespace.
* Try to comment the methods, attributes and classes you write. Use inline comments, plus the Doxygen-style headers. (prefixed with the @ character)
* Try to explain what a thing does in how you name it.
* Indent with four spaces. No tabs.
* No need to use curly braces with if, for, do, and while statements if they contain only one line of code. (but indent it)
* Curly brackets must be alone on a new line after the "if" of function signature.
* Declare local variables as close as possible to where they are used, not in the beginning of the method.
* Avoid raw pointers, in particular, wrap dynamically created objects (i.e. new) with shared_ptrs.
* Use "&&", not "and". Use "||", not "or". Use "!", not "not". (for better portability)
Version Number
--------------
It is made of major.minor.micro numbers. Releases with an odd minor version number are in an unstable branch, whose API and command line argument might change. (sometimes a lot) When the minor number is even, it means it's a stable branch, with only new features that don't break old ones, or bug fixes.
The micro version indicates the origin of the release: even micro numbers are only used for released archives; odd micro numbers are only used on the Git repository.
The version number is located in configure.ac and must always be one micro number ahead, unless this is a tag. That means that if we have released 0.1.0, the version number in configure.ac must be 0.1.1 until we release 0.1.2, and so forth.
API Version Nnumber
-------------------
It's made of the major.minor version numbers. In stable branches, the API and the ABI should be stable.
The ChangeLog File
------------------
It is generated by calling the following command:
$ git log --pretty=medium > ChangeLog
Creating a Tarball - The Release Process
----------------------------------------
Make sure the RELEASE notes, the NEWS file are up-to-date.
Make sure the version number in configure.ac is correct.
Commit any pending changes.
$ ./autogen.sh
$ ./configure
$ make
$ make distcheck
Create the tag in git.
$ git tag 0.2.0
Update the version number in configure.ac to the next release to come. Make a new commit.
The NEWS file
-------------
The NEWS file contains the release notes for the current (or next) release, and for all the releases before. We list there the bugs fixed and the new features. We also explain the reason for some changes if needed.
The README File
---------------
We use the GNU Autotools, and Automake overwrites the INSTALL file. Therefore, we write the installation instructions in the README file, along with a quick explanation of how to use the software, and what it does.
The TODO File
-------------
We store a list of things todo there.
Historic
--------
Let's talk about the choices made in this library and software.
We chose not to raise an exception if a given node is not found. We return a null pointer instead.